
November 13th, 2012, 01:40 PM
|
|
Contributing User
|
|
Join Date: Aug 2009
Posts: 49
Time spent in forums: 5 h 34 m 35 sec
Reputation Power: 4
|
|
|
How Would I Dynamically Change Meta Tag Information?
Hi Everyone,
How would I dynamically change meta tag information on a per page basis?
If a visit is on my "about" or "inventory" page. In the title and meta tag I would want that user to see "about us" or "inventory". I've written some below sample code but it's not working. Not sure what I'm doing.
For example, this page should be echoing out "Title Test Page" but it's not. What am I doing wrong here?
Thanks!
http://whatsmyowncarworth.com/class-work/sign3/titletest.php
PHP Code:
<?php
$title;
switch($_SERVER['PHP_SELF'])
{
case "/index.php":
$title = 'Home';
break;
case "/titletest.php":
$title = 'Title Test Page';
break;
}
print '<title>'.$title.'</title>';
?>
|