Re: header generation problem

From: Date: Sun, 03 Mar 2002 16:04:15 +0000
Subject: Re: header generation problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-86982@lists.php.net to get a copy of this message
On Sun, 3 Mar 2002, Jon Feldhammer wrote: >I'm trying to create a single dynamic header for a wide range of web >pages which I'll just include as I need it. There are a few things that >change per web page in the header, but I've settled all the issues >except a good way of how to modify a single image that changes based on >the web page being displayed. > >For example: >I'm displaying index.php, which includes 'header.php', the variable >$wpid indicates that the current web page is index.php. Now index.php >needs to display: (changing index_off.gif to index_on.gif) >index_on.gif anotherpage_off.gif yetanotherpage_off.gif > >(the tricky part is that each image will change to on depending on what >page is being displayed) > >I really haven't come up with an adequate solution. Ideas? Thanks. I usually program dynamic image names when I encounter this. <? $image = "banner"; if(isset($xmas_var)){ $image .= "_xmas"; } $image .= ".gif"; ?> <img src="<?=$image?>"> -- ----------------------------------------------------------------------- Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -----------------------------------------------------------------------

« previous php.general (#86982) next »