w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
jQuery convert URL to parameters across entire site
This kind of thing is generally determined by the server. For example if you are using apache to serve your files and you have a directory structure -web_root -CA -fairfield index.html index.html your request to mysite.com/CA/fairfield would fetch the index.html file in the fairfield folder on your server. If however you want one script for all your towns but still want separate urls then try something like serve with apache all paths under a domain through one script

Categories : Jquery

How does IE determine whether a site is an internet or an intranet site?
You can look in File -> Properties. Press Alt to display the menu bar if it's not there. There you can see "Local intranet" or "Internet".

Categories : Internet Explorer

how to access content from intranet site from mvc application?
In general, it is very bad security to impersonate a domain user when accessed via the internet. Chances are, if the intranet site was not made public it was made that way for a reason and you may be exposing company resources to attack by opening it up via a freely available website. A more safe approach would be to duplicate the logic of the intranet site you are looking to expose and meticulously merging its functionality onto a page in your external MVC app. It's more work, but it could potentially not cause you to be the reason hackers or script kiddies were able to steal valuable data. That being said, the way to impersonate a web request with authentication would be to make a series of HttpRequest objects, and storing the cookie information. This is how all of the authentication h

Categories : Asp Net

Simple intranet site with embedded pages
You cannot link an iframe to an external site (across domains) - try making another page and iframing that page. The most likely reason for the iframe not working is because the target site (in this case, Google) is sending a header to prevent other sites iframing it: X-Frame-Options: DENY A lot of sites will do this to prevent a common vulnerability known as UI Redressing or Click Hijacking. Some sites will also include some frame busting Javascript as a backup security measure to the HTTP header. From MDN: The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame> or <iframe>. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.

Categories : HTML

How do I create the licenses for MediaWiki site?
I was finally able to complete creating the licenses for my site. The method I was doing before was stupid and completely wrong. Thanks to Mir for pointing me out in the right direction. Here is the steps on how I ended up creating licenses for my Mediawiki. HOW TO CREATE LICENSES: - Tutorial In order to create licenses you need to do the following steps: 1) First figure out what licenses you want to list in your wiki. Its best to look at some samples to get an idea. Here are a few samples you can have a look at: Licenses Samples: MediaWiki Licenses: https://www.mediawiki.org/wiki/MediaWiki:Licenses Wikipedia Licenses: http://en.wikipedia.org/wiki/MediaWiki:Licenses https://en.bitcoin.it/wiki/MediaWiki:Licenses http://qed.princeton.edu/main/MediaWiki:Licenses 2) Next step is to c

Categories : Misc

Using active directory to authenticate users on intranet site
If you are looking only for authentication and nothing else, you may get away with only a few lines of code. First, ensure you have ldap enabled in your php. Here's pure php implementation: (note that when doing it this way you should ensure that you DO HAVE a username and a password from a user - anonymous binding will almost always return true for AD) $link = ldap_connect('domain.com'); // Your domain or domain server if(! $link) { // Could not connect to server - handle error appropriately } ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, 3); // Recommended for AD // Now try to authenticate with credentials provided by user if (! ldap_bind($link, 'username@domain.com', 'SomeSecret')) { // Invalid credentials! Handle error appropriately } // Bind was successful - continue

Categories : PHP

How to embed MediaWiki page content into my site?
Yes, it is. You'll probably want to use the action=render url parameter, for example: http://en.wikipedia.org/w/index.php?action=render&title=Main_Page. Note that the stylesheets from the wiki aren't included, so you'll need to copy the relevant rules to your site's css files. See also this.

Categories : HTML

Open internet explorer site in "Intranet mode" via powershell
Found a way, but would still be interested in how to do it via PowerShell: Open Group Policy Editor, go to: User Configuration > Administrative Templates > Windows Components > Internet Explorer > Internet Control Panel > Security Page Open "Site to Zone Assignment list" Set Enabled, Click "Show" and enter: Value Name: your site (ex: portal.site.local) Value: 1

Categories : Internet Explorer

export wordpress posts to a mediawiki
This is two problems. Export then import. Wordpress has a built in export ability but it may require installation of an official plugin to make full use of it. Check tools in the Wordpress admin menu. Mediwiki will require it's own PHP and/or XML scripts for importing and I've never used it to help you on that part.

Categories : Wordpress

How a deployed WCF service in Windows Azure with "Connected" Point-to-Site VPN can Communicate/Access a local Intranet?
When you configure Azure Virtual Network, you are responsible for name resolution. The first stop of one working with Azure Infrastructure Services (Virtual Machines / Virtual Network / Cloud Services) is the very important to read article: Name Resolution in Windows Azure. However when working with PTS (Point-To-Site) VPN, you are aware that as of today it is CTP. Thus you practically cannot get out-of-the box easy solution to resolve local machines from the cloud when using PTS VPN. This is not the case with STS (Site-To-Site) VPN. Simply because PTS VPN assigns IP Address randomly to the connected machines, while with STS VPN you are in control of all the IP Addresses assigned to your local network. Also note, that STS VPN can be established using Windows Server 2012 as a VPN gateway f

Categories : Wcf

How to convert "42°33'N, 1°33'E" to "42.55|1.55" in Scribunto (MediaWiki-hosted Lua)
This assumes the input string is strictly of the form in the post. If there's any variability e.g. it can omit the minutes, include seconds, latitude and longitude can be separated differently, or whatever, the pattern will need to change. function translate_coords(str) assert(type(str)=="string") local patt = "(%d+)°(%d+)'([NS]), (%d+)°(%d+)'([WE])" local latd,latm,latdir,lngd,lngm,lngdir = string.match(str,patt) assert(latd and latm and latdir) assert(lngd and lngm and lngdir) latd = latdir=="S" and -latd or latd lngd = lngdir=="W" and -lngd or lngd return ""..(latd+latm/60).."|"..(lngd+lngm/60) end

Categories : Lua

Subdomain Points to Subfolder and need .Htaccess to Redirect to a Wordpress Multi-Site Sub-Site
Well, depending on your provider, you can point your subdomain towards the same directory of your top level domain, i.e.: example.com -> /public_html/ this.example.com -> /public_html/ But your question is not clear about what you are trying to do. Is it a subdomains network or is it a subfolders network? If subdomains, try to change the directory your subdomain points to as in the example above, and create the blog inside wp-admin/network/ If subfolders, then you don't need the subdomain, unless you really want to redirect it to a subfolder just like an easier to remember shortcut, in that case you don't need a RewriteRule, WP takes care of the virtual subfolder.

Categories : Wordpress

CodeIgniter: Way to use variable across entire site?
I'd extend CI_Controller with a custom subclass that includes that variable, then have all the actual controllers extend that. CodeIgniter makes it easy - just create application/core/MY_Controller.php containing something along these lines: class MY_Controller extends CI_Controller { private $cached_url_seg; function MY_Controller() { parent::construct(); $url_segment = $this->uri->rsegment_array(); //get array of url segment strings $this->cached_url_seg = $url_segment[1]; //gets string of first url segment } } And then change your controllers to extend MY_Controller. You'll still have to add it to $data in each individual controller, but I suppose if you wanted you could add private $data to MY_Controller, too.

Categories : PHP

Keep htaccess redirect on entire site
3 approaches, quickly summarised, none of which have anything to do with mod_rewrite / .htaccess (making this an example of what I just learned is called the XY Problem): Set a cookie with the affiliate they came from. Ignore the URL once that cookie is set, and credit the booking to the appropriate affiliate. (If you're using a PHP session already, you can stick the affiliate in there, which comes to much the same thing.) Rewrite all your URLs in your PHP code so that whenever you display a link or form, it pushes to the appropriate URL. Much harder to write and easier to introduce bugs. Use sub-domains rather than sub-directories - e.g. affiliate42.example.com - and make all your links base-relative. One stumbling-block is that you'll need a wildcard SSL certificate which covers all th

Categories : PHP

Apache 2.4 -- how to close entire site except one subdirectory?
Use LocationMatch instead: <LocationMatch "!^/foo"> # lock down everything EXCEPT /foo </LocationMatch>

Categories : Apache

How to display background-image on entire site
To prevent the white body-background from appearing: html, body { height: 100%; } #main { height: 100%; } For height: 100% to have an effect on #main, its parent also needs to have this setting (and its parent, etc.), or a fixed height. You could consider moving the background to body.

Categories : HTML

Is it possible to search for an item in the entire sharepoint site?
To find results for search you must configure the search crawler in central admin for that site. After updating all your items in the site just set the crawler. Now you can search for an item. Suppose if you update any items in the sharepoint then run that crawler again. So all updated values also comes in sharepoint search. You have to do programmatic approach for WPF control with search APIs. After this in Sharepoint designer for the search control icon you have to change the redirect url to page in which your control contains with required parameters. If you leave about WPF control then you can edit the xslt for the search result to show in cleaner way.. Find this link

Categories : C#

Persistent URL query string throughout the entire site?
If you just want to persist this exact query string on each page, why not set the linked pages to insert the string into a session variable. Then on each page link check to see if the session variable exists and add it to the query string when redirecting.

Categories : PHP

MVC Windows authentication - authorise(permissions) for entire site
As @asawyer mentioned using global filter for your case is good practise. For another part of your question in comment: in the global filter where do i specify what AD groups are allowed to use the site? you can specify roles in OnAuthorization method of your custom authorize attribute, smth like: public class MyAuthAttribute: AuthorizeAttribute { public override void OnAuthorization(AuthorizationContext filterContext) { Roles = 'ad role1, ad role2...'; //Roles is AuthorizeAttribute member base.OnAuthorization(filterContext); } } and than use it like: GlobalFilterCollection.Add(new MyAuthAttribute()); in global.asax or w/e else

Categories : Asp Net Mvc

Redirect an entire directory on a WP site to a new domain, with a few subdirectory exceptions
I think you just want something simple: RewriteRule ^2012/$ http://www.newdomain.com/blog/ [L,R=301] RewriteRule ^2012/subdirectory/?$ http://www.newdomain.com/blog/subdirectory/ [L,R=301] Or maybe: RewriteRule ^2012/(.*)$ http://www.newdomain.com/blog/$1 [L,R=301] These rules need to be before any wordpress rules in your htaccess file.

Categories : PHP

Rails 2 - How to Use a Different Layout for an entire sub-site but still be able to use existing Controllers and Models
I read the answer you posted, it makes sense, I just try to give you some real codes in your case. You have a sub site, it means that your path of all pages in sub site will start with '/portal', right? In your app/views/layout , you can add a layout named "portal_subsite.html.erb". In your application_controller.rb class ApplicationController < ActionController::Base layout :get_layout private def get_layout if request.path.start_with?('/portal') 'portal_subsite' else 'application' end end end I have not a environment of Rails 2 now, but I think it should work, if you have any questions, please comment below.

Categories : Ruby On Rails

301 Redirect entire site to new directory except for index.html landing page
The following code does what you are asking for: "if the request does not match either index.php or index.html or "/" (i.e. nothing) (and the match is not case sensitive) then serve up the alternate location" Order deny,allow ErrorDocument 404 /404.php DirectoryIndex index.php index.html RewriteEngine On RewriteCond %{REQUEST_URI} !^/index.(php|html) [NC] RewriteCond %{REQUEST_URI} !^/$ {NC] RewriteRule ^.*$ http://example.com/portal/$0 [R=301,L] I have tested this using the excellent online testing tool http://htaccess.madewithlove.be Using the following test cases: http://example.com -- no rewrite, second condition not met http://example.com/ -- ditto http://example.com/index.html -- first condition not met http://example.com/index.php -- first

Categories : Htaccess

count total clicks made by user on entire site and change background accordingly
You can do that easily with jQuery: EDIT with $.cookie usage: var totalClicks = ($.cookie('totalClicks' !== null) ? $.cookie('totalClicks') : 0; var clicksLimit = 10; $.cookie('clicksLimit', clicksLimit); // just so that you do not have to re-declare this variable on the other page. $('body').on('click', '*', function() { totalClicks++; if(totalClicks >= clicksLimit) { alert('do something here...'); // precise to your request: $('body').css('background-color', '#f00'); // will turn body background to "red" } $.cookie('totalClicks', totalClicks); });

Categories : HTML

New Relic RESTful API: Returning aggregate data for the entire site in a custom time series
The threshold_values API call returns information similar the information you see in your application list including the health status color for each listed application. There is a small difference in that the API call reflects data aggregated over three minutes whereas the application list values are aggregated over five minutes. The time frame for this API call is not configurable. The possible values of the health status are as follows: 1 = green 2 = yellow 3 = red poor performance 4 = red application down (ping failures) Most other New Relic API calls can include a begin and end time. Here's an example from the New Relic docs: curl -gH "x-api-key:REPLACE_WITH_YOUR_API_KEY" 'https://api.newrelic.com/api/v1/accounts/REPLACE_WITH_YOUR_ACCOUNT_ID/applications/REPLACE_WITH_YOUR

Categories : Rest

Using WordPress login system for an entire website?
There is no known drawback with using WP's login system, it's WP after all, you can allow people to log in/out from the frontend using Sidebar Login Yet, the only drawback I see with this is that it will be so obvious that you are using WordPress and you won't be able to customize the look and feel of the backend as if you were using Drupal (where you can set backend themes). Other than that, you will probably want to: Modify roles: User Role Editor Remove some admin pages and menus : Admin Menu Editor Remove unused profile fields : Remove Fields

Categories : Wordpress

Wordpress sliding drawer plugin doesn't stay closed after converting page to HTML
Is the jQuery script library loading properly? I am doubtful of the src URL of your script at the document head: <script type="text/javascript" src="./jquery.js"></script> These URLs might be the problem. It may work correctly in your local server, but not on a live URL. You may need to change it to "/jquery.js" because the "." refers to the current directory. The "/" right at the start refers to the root URL. <script type="text/javascript" src="/jquery.js"></script> Please try it and let me know the result.

Categories : Javascript

url Canonicalization for wordpress site
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </IfModule> Try this. And get rid of the top line Redirect 301 / http://www.drwagenberg.com/

Categories : Wordpress

SSL on only one page of Wordpress site
In your Wordpress WP-Admin settings, you will have set the URL for the website, which Wordpress will use for handling all URLs (including links to CSS, JS, etc files). Is there any reason you can't run your entire Wordpress website on SSL? It's a much cleaner solution then jumping in and out of SSL for specific pages of your site.

Categories : Wordpress

Optimising a big Wordpress site
With issues like this, the thing to do is take the caching out of the hands of Wordpress, and make the server to the work. Software like Wordpress and Drupal do have their own caching systems, and you should enable them, but even with them in use, there's still a certain amount of overhead for the software to load and serve the page. So I suggest you investigate a server caching engine such as Varnish. This will dramatically reduce the server load for most sites like yours; if you have a lot of requests for the same page over and over, Varnish will take over the caching and Wordpess will never even have to know that the page is being requested. No more loading PHP and the Wordpress core for every request, no more database session with every request. If your back-end CMS software is sta

Categories : PHP

How do I convert my entire div data into image and save it into directory without using canvas?
You might want to look into a Flash-based solution if you can't use <canvas> (though unless this specifically needs to work in old versions of IE I'm not sure why you can't). http://flashcanvas.net/ is an emulation of <canvas> using Flash that might get you where you need to go. The documentation says that it supports toDataURL() so that might work for you. Can you provide more insight into what your restrictions around <canvas> are and what you've attempted to try already? //EDIT According to your comment below you might be able to use <canvas>, in which case you can try using http://html2canvas.hertzen.com – it's a JavaScript solution that basically re-writes the DOM of a specified part of your code to a <canvas> and then allows you to interact with it

Categories : PHP

php check mysql wordpress site
There is no reason to use raw SQL for this. Actually, there is already a function in Wordpress that will do exactly this: get_page_by_title(). Simply pass the title as a string argument into the function and it will return the post object for the matching post. If multiple post share the same title it will simply return an array of posts.

Categories : PHP

Display Wordpress Site Title
You are not outputting anything to show. You are only assigning blog name to a variable. You need to echo the content. It should be : <h1><?php echo get_bloginfo( 'name' ); ?></h1> Hope this helps :)

Categories : PHP

In Wordpress, Getting The Site URL Inside a Stylesheet
Have you tried removing the slash in front <style> @media (max-width: 420px){ .home-background { background-image: url('images/home_page/bg-mobile.jpg'); } } </style>

Categories : Javascript

Wordpress Site Will Not Index In Google
It could be that your sitemap is empty so you're giving him nothing to crawl ? http://www.barre101.com/sitemapindex.xml Although if you have links from external sites, you will get indexed right away ... Do check your sitemap though, and correct that and then add it to sitemaps in webmaster tools. Wordpress is really fast to index, really!

Categories : Wordpress

Moving Wordpress site to new server same URL
Use phpmyadmin on the new host to check the table prefixes of the imported database. The "new install" issue means wp-config.php isn't reading the correct database tables. Or, open the database dump and check the database table prefix. And, of course, be sure your database name, user and password are all correct in the new wp-config.php. If you are not changing the domain, there is no need to change URLs in the database. If you do change domains, use http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ to correctly change URLs in plain and serialized data.

Categories : Mysql

displaying wordpress post on another site
You don't need to connect directly to the blog database. You can simply create a new file in your Wordpress directory and include the wp-blog-header.php file: Example: <?php require('./wordpress/wp-blog-header.php'); // change this to fit your path ?> <p>Recent Posts:</p> <ul> while (have_posts()) : the_post(); ?> <li><?php the_title(); ?> </li> <?php endwhile; ?> </ul> Hope that helps!

Categories : PHP

Wordpress Site RSS Feed link
You are closing </div> inside your <a> element. You might want something like this: <div id="rss_link" style="margin-left:35%; margin-right:20%; width:10em;"> <a href="http://therearenoroads.com/feed"> <img style="width:90px; height:90px;" src="http://blog.sironaconsulting.com/.a/6a00d8341c761a53ef0120a7abc384970b-120wi" alt="RSS Link" /> <p style="font-size:1.3em; text-align:center;">Feed of TANR Knowledge</p> </a> </div> Additionally, this also happens in chrome when you click on most rss feeds, since it doesn't have a rss subscribe widget in it. In firefox, the feed is handled much more smoothly.

Categories : Wordpress

Can't access the backend of my wordpress site
did you try clearing your cache and cookies? is this a shared hosting or dedicated hosting? If you get these errors with a fresh install, default theme and no plugins, on a shared hosting, I'd ask the hosting company because it is not normal ...

Categories : Wordpress

ie8 ignoring styles on WordPress site
You seem to have some HTML issues that IE8 isn't handling quite as gracefully as the other browsers. Some of the worst offenses are apostrophes in HTML attributes, which prematurely end the attribute. W3C validator results

Categories : CSS

wordpress site is only displaying 5 posts
You see 5 post because it's default value in your wordpress admin. It's not 100% right way, but you can do the same by using this construction: <?php $myposts = get_posts('cat=1&numberposts=-1&'); foreach($myposts as $post) : ?> <?php the_time(__('d/m/Y')) ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?> <?php endforeach; ?> Where "cat" - category name/ID. Also you can try to remove "cat=" if you need all categories.

Categories : Wordpress



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.