These are the basic segment to consider while optimize your pages for search engines (SEO).
Nowadays search engines give high ranking to those pages which has high traffic. However Meta description, Meta keywords and page title can help you to improve your ranking in search engines.
<html>
<head>
<meta name="description" content="Meta description, Meta keywords and Title are the basic segment to consider while optimize your pages for search engines." />
<meta name="keywords" content="SEO, search engine optimization" />
<title> How to optimize pages for search engines</title>
</head>
<body>
Page contents goes here.
</body>
</html>
- Meta Description
- it should be small short brief about your page, make it short one or two sentences maximum
- meta description should be relevant to page contents
- Meta Keywords
- do not use too many keywords
- I recommend to use 7 keywords for single page
- The keywords should relevant to page content
- Add keywords like “php jobs nagpur”, “sisnolabs” not “php jobs in nagpur”, “about sisnolabs”
- Initially do not go with very popular keywrods
- Page Title
- page title should be relevant to page contents
- it should not be too long
- avoid using same keywords again and again
Whether you have static pages or dynamic, do try to add Meta keywords, Meta description or Titles unique for all pages.
Note: do not keep more than 75 links on single page, some search engines avoid those pages.
Do read my previous post on SEO – Easy steps to generate traffic
Good luck!!
PHP is used to create dynamic web pages, there are different ways to embed HTML code in your PHP pages. I believe you have read through my first session on php beginners.
- we can write html and php code separately using template system like Smarty, PHP Fast Template
- one more thing to remember, php code first executes on server and html is used to display the details on browser.
example1.php – embed html and php code together. dot (.) operator – returns the concatenation of its right and left arguments
<?php
$varMos = 3;
$userId = 5;
$pageName = "sisnolabs";
?>
<html>
<head>
<title>PHP and HTML </title>
</head>
<body>
<div align="center">
<?php
echo "This is PHP code";
?>
<br />
<?php
if ($varMos >= 3) {
echo "Good";
}
?>
</div>
<div> </div>
<?php
echo "<div>This is another PHP code </div>";
if ($userId > 0 && trim($pageName) != "") {
echo '<div><a href="index.php?id='.$userId.'&page='.$pageName.'">View Details</a></div>';
} else {
echo '<div><a href="index.php">Back</a></div>';
}
?>
</body>
</html>
example2.php – loop through array and display the details in html table. foreach – iterate over arrays.
<?php
$arrColors = array();
$arrColors[] = "Blue";
$arrColors[] = "Red";
$arrColors[] = "Green";
$arrColors[] = "Yellow";
$arrColors[] = "Pink";
$arrColors[] = "Purple";
$arrColors[] = "Orange";
?>
<html>
<head>
<title>PHP and HTML </title>
</head>
<body>
<table cellpadding="3" cellspacing="2" border="1" width="200" align="center">
<?php
foreach ($arrColors as $key=>$val) {
echo "<tr><td>".$key."</td><td>".$val."</td></tr>";
}
?>
</table>
</body>
</html>
will post next session soon, stay tuned.