fusionpixel Posted March 22, 2007 Share Posted March 22, 2007 If I add my Keywords and Metatags on the fly with a PHP include, would that breat any search engines from reading them? Me says not but not 100%sure TIA Quote Link to comment Share on other sites More sharing options...
cmgmyr Posted March 22, 2007 Share Posted March 22, 2007 Here is a little something that I use: <?php $page = $_SERVER['PHP_SELF']; $page = str_replace('/', '', $page); include "connect.php"; //Find the meta data $sql = mysql_query("SELECT * FROM meta_data WHERE page = \"$page\"") or die('Query failed: ' . mysql_error()); $count = mysql_num_rows($sql); if($count > 0){ $page_title = mysql_result($sql, 0, 'title'); $keywords = mysql_result($sql, 0, 'keywords'); $description = mysql_result($sql, 0, 'description'); $page_title = stripslashes($page_title); $keywords = stripslashes($keywords); $description = stripslashes($description); if(strlen($page_title) > 0){ $page_title .= " "; } }else{ $sql = mysql_query("SELECT * FROM meta_data WHERE page = \"default.php\"") or die('Query failed: ' . mysql_error()); $page_title = mysql_result($sql, 0, 'title'); $keywords = mysql_result($sql, 0, 'keywords'); $description = mysql_result($sql, 0, 'description'); $page_title = stripslashes($page_title); $keywords = stripslashes($keywords); $description = stripslashes($description); } ?> it just pulls the metadata from the DB for the page specified (if I put something into the DB). Then I just echo it in the html where it needs to go hope this helps. Quote Link to comment Share on other sites More sharing options...
Kerblam Posted March 22, 2007 Share Posted March 22, 2007 To any visitor, robot, spider or genuine user, the data they receive from a page is the same. If you include it or echo it or if it's just html, the browser doesnt know any different. So dont worry, search engines will still see your keywords and descriptions. Quote Link to comment Share on other sites More sharing options...
fusionpixel Posted March 22, 2007 Author Share Posted March 22, 2007 Thanks for the confirmation and the idea to use a DB to add the information. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.