To Make 100 % SEO based website

1- Page Title

• Each page should have unique title.

• Title characters would be relevant to the content on the page

• Preferable title length include space is 66 Characters

• Below way is preferable unique keyword should be first in title with repeated text like

• i.e

<title> Video - Teentimelive.com | Beta</title>

<title> Game - Teentimelive.com | Beta</title>

<title>User profile - Teentimelive.com | Beta</title>


2- Meta description

• Each page should have well known and contents matching description.

• There should be maximum 150 Character length of meta description

• Never use Meta in tag use ‘meta’

• i.e <meta name="description" content="your_keywords_here followed by a statement about your product service or organization." />


3- Meta Keywords

• Each page should have well known and page contents matching keywords.

• Meta keywords should be comma separated

• There should be maximum 10 keywords in meta tag

• Never use Meta in tag use ‘meta’

• Approximately 800 characters in this tag (including spaces).

• Keywords would be squeeze

• i.e <meta name="keywords" content=" beat, buy, download, fix, order " />


4- Title Meta Keywords and Description sequence

• Use this below sequence for tags

• i.e

<title>User profile - Teentimelive.com | Beta</title>

<meta name="description" content="your_keywords_here followed by a statement about your product service or organization." />

<meta name="keywords" content=" beat, buy, download, fix, order " />


5- Use Headings

• Headings play an important role in organizing information, so be sure to include at least H1-H3 when assembling your page.

• Try to get at least 400+ words on each page.

• i.e <h1>Teen Time Live Featured Videos </h1>

<style type="text/css">

h1{ font-size: 18px; }

h2{ font-size: 16px; }

h3{ font-size: 14px; }

</style>


6- Use Title and ALT Attributes

• In all anchor tags use title attribute with relevant keyword in Title field

• In all Image tags use alt attribute field with relevant keyword in Alt field

• i.e

<a href="http://www.teentimelive.com/forum/ " title="Teentimelive Forum">Forum</a>

<img src=" http://www.teentimelive.com/img/image01.jpg" alt="All Videos" />


7- Image Name

• Use proper name instead abbreviation name for images

• i.e

<img src=" http://www.teentimelive.com/img/golf-putters-01.jpg" alt="golf putters " />


8- Create Sitemap.xml

• create xml based site map and placed in web root directory

• Sitemap.xml should be properly validated

• Should be accessible like http://www.teentimelive.com/sitemap.xml

• Approved the sitemap from google, yahoo and MSN web master tools

• i.e

<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

<url>

<loc>http://www.example.com/</loc>

<lastmod>2009-01-01</lastmod>

<changefreq>monthly</changefreq>

<priority>1.0</priority>

</url>

</urlset>


9- Sitemap web Page

• There should be a page which contains all public accessible pages link in the form of anchor tag


10- Create robots.txt file

• There should rebots.txt file which have list of no accessible folders or file path

• Robots.txt should be at web root directory of website

• i.e robots.txt

User-agent: *

Disallow: /cgi-bin/

Disallow: /includes/

Disallow: /css/


11- Validate your HTML and CSS

• HTML and CSS should be properly validate by using

http://validator.w3.org


12- Back links

• Use as maximum back links

javascript isset()

Have you ever wanted to test the existance of a javascript variable
(an array item for example) ?
Just like in PHP, I’ve found a method to do this.

The function returns true if the variable is set or false if the variable was not set.
A variable to be set must be initialized.
The starting point was that an unitialized variable has the type ‘undefined’.

A basic method can look like this:




Code (javascript)



function isset(varname){

return(typeof(varname)!=‘undefined’);

}

 


Some problems appear with this implementation, as Glen reported.



One problem is that when you pass an undefined variable, javascript throws an exception.

The other problem is that function member names can mess up the detection. (ex: pop() for array)

So here is a modified version. Please note the try/catch trick:



Code (javascript)


<script type="text/javascript">


function isset(varname)


{

try

{

var t = typeof(varname);

}

catch(e) {return false;}



if(t!==‘undefined’ && t != ‘function’) return true;

else

 return false;


}


var global_var = new Array();


function test()

{

var local_var = "xx";



try

{          

document.writeln("Test for function name (should be false) global_var[\"pop\"].Answer: " + isset(global_var["pop"]) + "


"
); // returns false - as global_var.pop() is a function

}

catch(e) {alert(e) /*code for not set*/}


try

{          


document.writeln("Test for global var (should be true).\nAnswer: " + isset(global_var) + "

"
); // returns true as global_var is set

}

catch(e) {alert(e) /*code for not set*/}



try

{          

document.writeln("Test for defined local var (should be true).Answer: " + isset(local_var) + "

"
); // the script does not support testing local vars… always returns false


}

catch(e) {alert(e) /*code for not set*/}


try

{          

document.writeln("Test for bogus var which is not defined (should be false).Answer: " + isset(bogus) + "


"
); // returns false as bogus var is not defined

}

catch(e) {alert(e) /*code for not set*/}



}


test();



</script>

 


santa to banta

Santa: Oye tu har message Do dafa q karta hay?
Banta: Taa k tu aik Forward kar de to doosra tere pas rahay!

sardar ka interview

Ek sardar ji ka Electric Engineer ki post k liye interview tha.
Interviewer: Electric motor kaisay chalti hai?
Sardar ji: TorrRrrRrrRrrrrRrrr

sardar with wife

A sardar & his wife were waiting for train.
Itne me KHYBER MAIL aa gai.
Sardar bhag k train me charha or apni wife se bola: Jab KHYBER FEMALE aye to aajana .

amercian to sardar

American to Sardaji: Hamaray country main 90% shadiyan Email se hoti hain
Sardarji: kamal hai hamaray desh main 100% shadiyan Female se hoti hain

sardar k baapki death

Ek Sardar baap ki death pe buhut roya, phir uski sister ka phone aya. Phone sunkar wo aur bhi ronay laga. Logon ne pucha kyon ro rahay ho?
Sardar: meri behen k abbu ka bhi intiqaal hogaya.

RSS

RSS (most commonly translated as "Really Simple Syndication") is a family of web feed formats used to publish frequently updated works—such as blog entries, news headlines, audio, and video—in a standardized format.[2] An RSS document (which is called a "feed", "web feed",[3] or "channel") includes full or summarized text, plus metadata such as publishing dates and authorship. Web feeds benefit publishers by letting them syndicate content automatically. They benefit readers who want to subscribe to timely updates from favored websites or to aggregate feeds from many sites into one place. RSS feeds can be read using software called an "RSS reader", "feed reader", or "aggregator", which can be web-based, desktop-based, or mobile-device-based. A standardized XML file format allows the information to be published once and viewed by many different programs. The user subscribes to a feed by entering into the reader the feed's URI – often referred to informally as a "URL" (uniform resource locator), although technically the two terms are not exactly synonymous – or by clicking an RSS icon in a browser that initiates the subscription process. The RSS reader checks the user's subscribed feeds regularly for new work, downloads any updates that it finds, and provides a user interface to monitor and read the feeds.

"SELECT" and CSS with BROWSER Compatible Issues




Just gone through an issue regarding adding some style sheets on the "OPTION" tag of the "SELECT" box... and come up with an browser compatible issue that IE do not support such type of work. However Firefox goes well.Lets have an example:If we want to highlight, change selected value fonts or make changes in the font-weight it will not effect in IE at all.Just have a look this code in Both browsers and have a look the difference :
This is bold text
This is normal text

This is also being under discussion from several analysis point of view that IE may have playing some contradictory part with OPTGROUP. Here i am also mentioning couple of discussion forum links where these issues came under observations. Hope some or none might help you in knowing these in near future.

Forum Discussion 1 - forums.devshed.com
Forum Discussion2 - forums.whirlpool.net.au

XML Parsing into PHP array

At EVS we have been working many web services projects. these web services return XML that cannot be used directly. this function will convert XML into PHP array. by using this array we can extract data very easly.


$DataArray = xml2array($DataXML);


function xml2array($contents, $get_attributes=1)
{
if(!$contents) return array();
if(!function_exists('xml_parser_create'))
{
//print "'xml_parser_create()' function not found!";
return array();
}
//Get the XML parser of PHP - PHP must have this module for the parser to work
$parser = xml_parser_create();
xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );
xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );
xml_parse_into_struct( $parser, $contents, $xml_values );
xml_parser_free( $parser );

if(!$xml_values) return;//Hmm...

//Initializations
$xml_array = array();
$parents = array();
$opened_tags = array();
$arr = array();

$current = &$xml_array;

//Go through the tags.
foreach($xml_values as $data)
{
unset($attributes,$value);//Remove existing values, or there will be trouble
extract($data);//We could use the array by itself, but this cooler.

$result = '';
if($get_attributes)
{//The second argument of the function decides this.
$result = array();
if(isset($value)) $result['value'] = $value;

//Set the attributes too.
if(isset($attributes))
{
foreach($attributes as $attr => $val)
{
if($get_attributes == 1) $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'
/** :TODO: should we change the key name to '_attr'? Someone may use the tagname 'attr'. Same goes for 'value' too */
}
}
}
elseif(isset($value))
{

$result = $value;
}

// See tag status and do the needed.

if($type == "open")
{ //The starting of the tag ''
$parent[$level-1] = &$current;

if(!is_array($current) or (!in_array($tag, array_keys($current))))
{ //Insert New tag
$current[$tag] = $result;
$current = &$current[$tag];

}
else
{ //There was another element with the same tag name
if(isset($current[$tag][0]))
{
array_push($current[$tag], $result);
}
else
{
$current[$tag] = array($current[$tag],$result);
}
$last = count($current[$tag]) - 1;
$current = &$current[$tag][$last];
}

} elseif($type == "complete")
{ //Tags that ends in 1 line ''
//See if the key is already taken.
if(!isset($current[$tag]))
{ //New Key
$current[$tag] = $result;

}
else
{ //If taken, put all things inside a list(array)
if((is_array($current[$tag]) and $get_attributes == 0)//If it is already an array...
or (isset($current[$tag][0]) and is_array($current[$tag][0]) and $get_attributes == 1))
{
array_push($current[$tag],$result); // ...push the new element into that array.
}
else
{ //If it is not an array...
$current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value
}
}

}
elseif($type == 'close')
{ //End of tag '
'
$current = &$parent[$level-1];
}
}

return($xml_array);
}

?>

Useful for Crawling Functions

Functions developed for crawling project at EVS। These functions are now being used be many guys here in EVS. here will find these functions along with a little documentation. feel free to use and modify them.

Useful for Crawling Functions

1) getdataA(startposition,endposition,string)

function getdataA($strStart, $strEnd, $text){

for ($i=0;$i<=strlen($text);$i++)

{

if (substr($text,$i,strlen($strStart))==$strStart)

{

$st=$i;

$k=$i;

while (substr($text,$k,strlen($strEnd))!=$strEnd)

{

$k++;

}

$en=$k+strlen($strEnd);

$start=$st+strlen($strStart);

$tmpstr= substr($text,$start,$k-$start);

}

}

return $tmpstr;

}

Explanation of the function:-

Lets suppose variable $tempdata contains the following string of data

How to use:-

If we use this function i.e getdataA, we should use as

$data = getdataA(��,�

�, $tempdata)

This function will return us a string, which contains all the data in $tempdata excluding tag i.e it will return us

Mean the starting and ending portions has been removed from the $tempdata.

2) getdataB(startposition,endposition,string)

function getdataB($strStart, $strEnd, $text){

for ($i=0;$i<=strlen($text);$i++)

{

if (substr($text,$i,strlen($strStart))==$strStart)

{

$st=$i;

$k=$i;

while (substr($text,$k,strlen($strEnd))!=$strEnd)

{

$k++;

}

$k=$k+strlen($strEnd);

$start=$st;

$tmpstr= substr($text,$start,$k-$start);

}

}

return $tmpstr;

}

Explanation of the function:-

Lets suppose variable $tempdata contains the following string of data

How to use:-

If we use this function i.e getdataA, we should use as

$data = getdataA(��,�

�, $tempdata)

This function will return us a string, which contains all the data in $tempdata i.e it will return us. So by using this function i.e getdataB we can get all the data including starting and ending points motioned in the function.

Main difference between getdataA and getdataB

In the light of above given few examples we can easily conclude the difference between the functions getadataA and getdataB , i.e getdataA returns a string between the specified string or tag while getdataB returns the whole string including the starting and ending tag.

3) getdataC(startposition,endposition,string)

function getdataC($strStart, $strEnd, $text){

for ($i=0;$i<=strlen($text);$i++)

{

if (substr($text,$i,strlen($strStart))==$strStart)

{

$st=$i;

$k=$i;

while (substr($text,$k,strlen($strEnd))!=$strEnd)

{

$k++;

}

$en=$k+strlen($strEnd);

$start=$st+strlen($strStart);

$tmpstr= substr($text,$start,$k-$start);

break;

}

}

return $tmpstr;

}

Explanation of the function:-

This function returns us the data which occurs for the first time.Lets suppose variable $tempdata contains the following string of data

How to use:-

If we use this function i.e getdataC, we should use as

$data = getdataA(��,� �, $tempdata)

This function will return us a string, which contains following data form $tempdata i.e it will return us

Evision

So by using this function i.e getdataC we can get all the data including starting and ending points motioned in the function.

4) Function function reducere($text)

function reducere($text)

{

$a = array("\r", "\t", "\n");

$r = str_replace($a, '', $text);

return $r;

}

Explanation of the function:-

This function is used to remove extra spaces new line breaks and tabs.

5) function getdataArray(startposition,endposition,string)

function getdataArray($strStart, $strEnd, $text){

for ($i=0;$i<=strlen($text);$i++)

{

if (substr($text,$i,strlen($strStart))==$strStart)

{

$st=$i;

$k=$i;

while (substr($text,$k,strlen($strEnd))!=$strEnd)

{

$k++;

}

$k=$k+strlen($strEnd);

$start=$st;

$tmpstr[]= substr($text,$start,$k-$start);

}

}

return $tmpstr;

}

Explanation of the function:-

This function returns us an array of data.Lets suppose variable $tempdata contains the following string of data

How to use:-

If we use this function i.e getdataA, we should use as

$data = getdataArray�,� �, $tempdata)

This function returns us an array which include data such as

$data[0] = Evision

$data[1] = Software

$data[2] = Islamabad

So by using this function i.e getdataArray we can get an array of data excluding starting and ending tag.

Html Fieldset Rounded Corners - Internet Explorer (IE) and Firefox


I don't usually prefer anything about Internet Explorer. However, IE's default presentation for the Html fieldset tag just looks nicer. Firefox, on the otherhand, defaults to an ugly square box presentation.

So, to try to get Firefox to look more like IE (something I never thought that I would say) ...

fieldset { 
-moz-border-radius-bottomleft:7px;
-moz-border-radius-bottomright:7px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:7px;
border-radius: 3px;
}

I confess this only addresses IE and Firefox. Supposedly, Safari and Chrome will support rounded corners under their CSS3 support (eta?). I tried -webkit-border-radius: 3px;, but it never rendered correctly in the versions of Safari and Chrome that I have. I'm also assuming that Opera falls in this same category.


If you absolutely must have rounded corners: http://www.spiffycorners.com. However, I caution you against the author's approach because it requires too much Html for an effect that will be cleanly implemented in CSS3. Again, this is only a nice to have.


Example:


Title
contents



ISAPI Rewrite based URL manipulation module for IIS

ISAPI_Rewrite provides a rule-based rewriting engine to rewrite requested URLs on the fly. It supports virtually unlimited number of rules and virtually unlimited number of attached rule conditions to provide really flexible and powerful URL manipulation mechanism. The URL manipulations can depend on tests for HTTP headers, Server variables, the requested URL itself and various different conditions.

URL manipulations are established using text configuration files with set of directives inside. There are several levels of configurations. First global (server wide) configuration directives are placed in file with the name httpd.conf in the ISAPI_Rewrite installation folder. There are also several tags that can enclose directives to apply for special locations: , , , , , and . Finally ISAPI_Rewrite supports .htaccess files that can uppear in any directory inside a web site and rules from these files will apply to this location and subdirectories. All configuration files are reloaded automatically every time the file is changed. It is allowed to change file content from third party programs and scripts.

In most cases ISAPI_Rewrite is used to rewrite requested URL. In addition to rewrite ISAPI_Rewrite can modify, create or remove any other HTTP header of the client REQUEST. Module operation may lead in rewriting, proxying, redirection, or blocking of an original client request to a server.

Rewriting will cause server to continue request processing with a new URL as if it has been originally requested by a client. New URL can include query string section (following the question mark) and may point to any plain static files, scripts (like ASP), programs (like EXE), etc. within the same web application (which usually means same web site). Rewriting is completely transparent to the user and web site applications because it is done internally on a server and before web application receives request.

Proxying causes the resulting URL to be internally treated as a target on another server and immediately (i.e. rules processing stops here) passed to the remote server. Response of the remote server will then be passed back to the client. Proxy requires you to specify fully qualified URL, starting from protocol, host name, etc. ISAPI_Rewrite uses ISAPI extension to handle proxy requests. You can read more about this in configuring proxy chapter.

Redirection will result in sending of immediate response with a redirect instruction (HTTP response code 302 or 301) setting substituted URL as a new location. You can use an absolute URL format (and that is required by the RFC 2616) in redirection instruction to redirect the request to a different host, port and protocol. If this information is omitted, ISAPI_Rewrite will automatically supply URL with the current request's protocol, server name and directory location. Redirect instruction always causes rewriting engine to stop rules processing sequence.

Rules are applied in the order of appearance in configuration files. Directory level configuration files are processed file by file starting from the parents. Rules from global (server wide) configuration file are applied first. Order of rules is important because substitution result of one rule will become a source for subsequent rules application.

Before any URL modification ISAPI_Rewrite saves original URL into the HTTP header named X-Rewrite-URL. Then it can be retrieved in script as HTTP_X_REWRITE_URL server variable. Since in IIS world server variables cannot be modified ISAPI_Rewrite cannot provide this variable as REQUEST_URI for Apache compatibility. If your application is designed to rely on REQUEST_URI variable you will need to patch it to work with HTTP_X_REWRITE_URL variable instead. Here is a patch example for PHP code:

if (isset($_SERVER['HTTP_X_REWRITE_URL']))
{
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}

Multiple RewiteCond directives followed by RewriteRule (or RewriteProxy) directive affect only that single rule. If some condition has to be used with more than on rule, this condition directive should be repeated for every rule to apply.

resizing Image, Thumbnail for WIN and LINUX

To execute its functionality do:

< img src="img_resize.php?path=logo.jpg&imgWidth=100" >

and it will work.

Note: File formats supported are jpg, jpeg, png, gif and wbmp. For transparent images it showes black background.

Code is given bellow. Code file is attached also.

resizeimage( $_GET['path'], $_GET['imgWidth']);
function resizeimage($overlay, $autosize){
//Find if overlay image exists

if(!file_exists($overlay)) {
die("Overlay image does not exist.");
}
$extension_o = strtolower(substr($overlay, strrpos($overlay, ".") + 1));
//Load overlay image from file
switch ($extension_o)
{
case 'jpg':
$overlay = imagecreatefromjpeg( $overlay);
break;
case 'jpeg':
$overlay = imagecreatefromjpeg( $overlay);
break;
case 'png':
$overlay = imagecreatefrompng( $overlay);
break;
case 'gif':
$overlay = imagecreatefromgif( $overlay);
break;
case 'wbmp':
$overlay = imagecreatefromwbmp( $overlay);
break;
default:
die("Image is of unsupported type.");
}
// Get the size of overlay
$oowidth = imagesx($overlay);
$ooheight = imagesy($overlay);

$owidth = $autosize;
$oheight = $autosize;

$oheight = $ooheight * ($owidth/$oowidth);
$owidth = $oowidth * ($oheight/$ooheight);

$image_resized_o = imagecreatetruecolor($owidth, $oheight);
imagecopyresampled($image_resized_o, $overlay, 0, 0, 0, 0, $owidth, $oheight, $oowidth, $ooheight);
// make white color tarnsaparent for Overlay image
$img = imagecreatetruecolor($owidth,$oheight);

// from this one can make transparent given color RGB now it make white color //transparent
$trans = imagecolorallocate($img,255,255,255);
imagecolortransparent($img,$trans);
imagecopy($img,$image_resized_o,0,0,0,0,$owidth,$oheight);
imagetruecolortopalette($img, true, 256);
imageinterlace($img);
//=========================================================
header("Content-type: image/jpeg");
header("Content-Disposition: filename=" . $overlay);
imagejpeg($img); // to view image in web browser
}
?>

Coloring Your Scrollbars with CSS

To add the scrollbar property rules for the browser scrollbar or the textarea form field scrollbar.

As shown below:

* For the browser scrollbar colors, add the scrollbar property attribute rules to the body element.
* For the textarea scrollbars, add the scrollbar property attribute rules to the textarea element.

Here is the CSS for this,

body {
scrollbar-3dlight-color:#FFD700;
scrollbar-arrow-color:#FFFF00;
scrollbar-base-color:#FF6347;
scrollbar-darkshadow-color:#FFA500;
scrollbar-face-color:#008080;
scrollbar-highlight-color:#FF69B4;
scrollbar-shadow-color:#FF00FF;
}

/* CSS rules for the forms scrollbar */

textarea {
scrollbar-3dlight-color:gold;
scrollbar-arrow-color:yellow;
scrollbar-base-color:tomato;
scrollbar-darkshadow-color:orange;
scrollbar-face-color:teal;
scrollbar-highlight-color:hotpink;
scrollbar-shadow-color:magenta;
}