Menu bar

Wednesday 16 July 2014

Best places to put the keywords for Search Engine Optimizarion!

How to increase your website rank? Through SEO?
Yes..But how to work with it?

SEO especially work with the words.
For that we should know our website relevent words and WHERE TO PUT IT.
So here are the text which indicate where to put your website relevent words.




Here is a list of places where you should try to use your main keywords. 
  1. Keywords in the <title> tag(s). 
  2. Keywords in the <meta name="description"> 
  3. Keywords in the <meta name="keyword"> 
  4. Keywords in <h1> or other headline tags. 
  5. Keywords in the <a href="http://yourcompany.com">keywords</a> link tags.
  6. Keywords in the body copy. 
  7. Keywords in alt tags. 
  8. Keywords in <!-- insert comments here> comments tags. 
  9. Keywords contained in the URL or site address, e.g., http://www.keyword.com/keywordkeyword.htm.


Tuesday 15 July 2014

How to add shortcode in a widgets?

How to add shortcode means how to make shortcode runnable when paste  in a widget section.


277341190 3f098a08a4 t The Right Way To Shortcodize WordPress Widgets


Most advice on this converges to this simple line of code:
add_filter('widget_text', 'do_shortcode');
Though a wide spread method, this is not quite correct. The more correct way would be:
if (!is_admin())
  add_filter('widget_text', 'do_shortcode', 11);


if (!is_admin())
  add_filter('widget_text', 'do_shortcode', SHORTCODE_PRIORITY);


to avoid guessing what the number 11 means, but SHORTCODE_PRIORITY is a constant the WordPress team has yet to provide.

Sunday 13 July 2014

Detect Browser?

Detect the browser 

Detect the browser using javascript, whether it is Internet Explorer or Netscape Browser.




<html>
<head>
<title>Browser Detective</title>
<script>
var bVersion = 0;
var isNav = false;
var isIE = false;

function checkBrowser(){
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserName  = navigator.appName;
var fullVersion  = ''+parseFloat(navigator.appVersion); 
var majorVersion = parseInt(navigator.appVersion,10);
var nameOffset,verOffset,ix;

// In Opera, the true version is after "Opera" or after "Version"
if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
 browserName = "Opera";
 fullVersion = nAgt.substring(verOffset+6);
 if ((verOffset=nAgt.indexOf("Version"))!=-1) 
   fullVersion = nAgt.substring(verOffset+8);
}
// In MSIE, the true version is after "MSIE" in userAgent
else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
 browserName = "Microsoft Internet Explorer";
 fullVersion = nAgt.substring(verOffset+5);
}
// In Chrome, the true version is after "Chrome" 
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
 browserName = "Chrome";
 fullVersion = nAgt.substring(verOffset+7);
}
// In Safari, the true version is after "Safari" or after "Version" 
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
 browserName = "Safari";
 fullVersion = nAgt.substring(verOffset+7);
 if ((verOffset=nAgt.indexOf("Version"))!=-1) 
   fullVersion = nAgt.substring(verOffset+8);
}
// In Firefox, the true version is after "Firefox" 
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
 browserName = "Firefox";
 fullVersion = nAgt.substring(verOffset+8);
}
// In most other browsers, "name/version" is at the end of userAgent 
else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < 
          (verOffset=nAgt.lastIndexOf('/')) ) 
{
 browserName = nAgt.substring(nameOffset,verOffset);
 fullVersion = nAgt.substring(verOffset+1);
 if (browserName.toLowerCase()==browserName.toUpperCase()) {
  browserName = navigator.appName;
 }
}
// trim the fullVersion string at semicolon/space if present
if ((ix=fullVersion.indexOf(";"))!=-1)
   fullVersion=fullVersion.substring(0,ix);
if ((ix=fullVersion.indexOf(" "))!=-1)
   fullVersion=fullVersion.substring(0,ix);

majorVersion = parseInt(''+fullVersion,10);
if (isNaN(majorVersion)) {
 fullVersion  = ''+parseFloat(navigator.appVersion); 
 majorVersion = parseInt(navigator.appVersion,10);
}

document.write(''
 +'Browser name  = '+browserName+'<br>'
 +'Full version  = '+fullVersion+'<br>'
 +'Major version = '+majorVersion+'<br>'
 +'navigator.appName = '+navigator.appName+'<br>'
 +'navigator.userAgent = '+navigator.userAgent+'<br>'
)
}

</script>
</head>

<body>
<center>
<h1>Browser Detective<hr></h1>
<script>
checkBrowser();

if (isNav){
  document.write("Netscape Navigator");
} else {
  if (isIE){
    document.write("Internet Explorer");
  }
}

</script>
</center>
</body>
</html>



OUTPUT:


Saturday 5 July 2014

How to disable right click , F12 key and Direct link access?

Stop users from stealing your website images, copying content, or from inspecting the source.

In order to setup a security as above , the first is to disable right click ,disable F12 key and then disable direct link access.

Direct link access means that a user get full path of image by writing 'view-source:' before the domain name.
After getting the full path, user will type the full path of image in address bar to access images, So we have to avoid this attack also.
Use this code in your header file or where ever you required.

<body oncontextmenu="return false;">
Fires when the user clicks the right mouse button in the client area, opening the context menu.


<meta http-equiv="imagetoolbar" content="no" />
This turns off Internet Explorer's image toolbar that appears when you hover over an image.
Use this code within <head > tag.


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
Write this code in your .htaccess file