When building a dynamic webpage using php or perl. I recommend you also create dynamic meta content. I have written a couple of functions and files to make it possible to load meta content from a database.
PHP Code:
<?php DB_CONNECT ("databas"); $result = mysql_query("SELECT * FROM page_data WHERE name='$Page_name'"); if ($result == false || mysql_num_rows($result) == 0) { echo $Page_name; } else {
$data = mysql_fetch_array($result); $meta_description = $data['description']; $meta_keywords = $data['keywords']; $page_title = $data['title']; } DB_DISCONNECT (); ?>
this a little piece of code that pulls meta content on page name. but what about dynamic pages like a news page? well I added a table for meta content for all articles on my sites. Instead of including this file I just load the data from the meta content table for articles!
do you create dynamic meta content?
|