If you are like me, The pages of your site include from another file for easy changing of the site. However this doesn't let you set a custom title and description for each page which stinks. This tutorial shows you how to have your cake and eat it to.
Now, You are going to go to your top.php (Or whatever you named it) and paste this PHP Code before anything else.
<?php $titles = @file("titles.txt");
$count_titles=count($titles);
$script_name_rev=strrev($_SERVER['PHP_SELF']);
$script_name_parse=explode('/',$script_name_rev);
$script_name=strrev($script_name_parse[0]);
$page_title=""; $page_description="";
for ($i=0;$i<$count_titles;$i++){
if (strstr($titles[$i],"$script_name"."_title")){
$page_title_parse=explode("=",$titles[$i]);
$page_title=trim($page_title_parse[1]);
}
if (strstr($titles[$i],"$script_name"."_description")){
$page_description_parse=explode("=",$titles[$i]);
$page_description=trim($page_description_parse[1]);
}
}
?>
<title><?php echo $page_title; ?></title>
<meta name="description" content="<?php echo $page_description; ?>">


