So what I want to do is similiar to the title but with a different element. As you can see the titles under each article prints correctly on the site; however, I would like the description for each article to be applied in the metatag.... Any ideas on how to do this.... Your help is always appreciated. <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Build Ur Body - <? print $title ?></title> <meta name="Description" content="<? print $desc ?>"> <----obviously this doesn't work...... when I check the meta for it is shows up blank....
Figured it out...I had to make sure to call the query in the top... (not sure if thats the technical term but I'll show ya.) $id = explode("/",$_SERVER['PATH_INFO']); $id = $id[1]; $sql = mysql_query("select * from articles where id='$id' limit 1") or die(mysql_error()); $row = mysql_fetch_assoc($sql); $text = $row['text']; $title = $row['title']; $desc = $row['description'];<----- I added this..... // keep empty lines function nl2br2($string) { $string = str_replace(array("\r\n", "\r", "\n"), "<br />", $string); return $string; } ?> After I added that small code, the description was then printing in the metatag.