Re: dynamic meta tag and title app?

From: Date: Thu, 19 Nov 2009 15:48:52 +0000
Subject: Re: dynamic meta tag and title app?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-299935@lists.php.net to get a copy of this message
Hi Todd, This looks like a good starting point for me. I was going to use $_SERVER['PHP_SELF']; but I think ($_SERVER['SCRIPT_NAME']); in your example will always return just the script info and not additionally passed information, which will save me trouble shooting later! Thanks!!! On Thu, Nov 19, 2009 at 10:09 AM, tedd <tedd.sperling@gmail.com> wrote: > At 11:30 AM -0500 11/18/09, Jack S wrote: >> >> Hello All, >> >> Does anyone have a reference to a program that may be out there to >> help with using a single header.php for a site, but then dynamically >> loads different keywords , titles etc based on what page is including >> the header file? >> >> Sample: >> If home page include it knows the title and other variables would be >> home, about us would be about etc. >> >> -- >> Thanks! >> Jack > > Jack: > > I do this for my site. It's pretty simple -- please follow: > > <head> > <?php > $self = basename($_SERVER['SCRIPT_NAME']); > > switch($self) >   { >   case 'index.php': >   ?> >   <title>Title of Index Page</title> >   <meta name="keywords" content="Keywords for Index Page"> >   <meta name="description" content="Description for Index Page"> >   <?php >   break; > > and so on. > > Cheers, > > tedd > > -- > ------- > http://sperling.com  ¦_ŒOî > ³\<­P,JC4http://ancientstones.com >  http://earthstones.com > -- Thanks! Jack

« previous php.general (#299935) next »