Jump to content

dynamic page titles


Sibkis

Recommended Posts

when you say title, do you mean the title displayed in the browser's tab bar?as that is set in the <title> tag.you could use javascript to move it from a h1 tag to the title tag, but it would be normal and much better to just echo it in the title tag.

Link to comment
Share on other sites

if you are already generating that content from PHP, then echo would work. if the content is static, then you would need to use javascript.

Link to comment
Share on other sites

neither the h1 or the titles are generated by php. but the main content is dynamic using php.I will have a look at javascript. <?php $content_dir = 'content'; if (!empty($_GET['p'])){ $content = scandir($content_dir,0); unset($content[0],$content[1]); $p = $_GET['p']; if (in_array($p.'.inc.php',$content)){ include($content_dir.'/'.$p.'.inc.php'); }else{ echo 'Sorry , Page Not Found.'; } }else{ include($content_dir.'/home.inc.php'); } ?> thats what I am using for the content

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...