I have a php website with a single header that includes the title tag. Of course what this means is that every page on my website has the same title which basically means for SEO this is a bad thing. Is there a way that I can tell the title to change based on the link that is clicked? If you don't understand my horrible explanation then basically what i'm looking for is a way to make the title different on every page when using the same header.
Yeah but how? lol I figured there was a way just need a push in a direction of how. I am pretty good with php but want a clean way of producing different titles on each page using one header.php file.
example: in header include: $page = $_SERVER[PHP_SELF]; $sql = mysql_query("SELECT title, keywords, description FROM seo WHERE page='$page'"); while ($row = mysql_fetch_array($sql)) { echo "<title>$row[title]</title>"; echo "<meta http-equiv=\"description\" content=\"$row[description]\" /> echo "<meta http-equiv=\"keywords\" content=\"$row[keywords]\" /> } Alternatively you can just use single apostrophes and avoid all the escaping.