Re: Cell Colour Change!!! HELP

From: Date: Fri, 07 Nov 2003 16:16:58 +0000
Subject: Re: Cell Colour Change!!! HELP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-168863@lists.php.net to get a copy of this message
> I have a cell in my view.php which shows up in all my pages of my site. This > is wha tI need to do: > > If the user is on the home page(index.php) then the cell colour should be > blue. > If the user is on the compose page(compose.php) then the cell colour should > be green > If the user in on the registration page then the colour should red > and if the user is on the contac us then the color of thecell should be > yellow! > > Can some one point me to an example or provide me with a basic php code > structure to work with. You could check the name of the current page and set a variable for the cell color accordingly. Something like: if (eregi("index", $PHP_SELF)) { $color = "blue"; } elseif (eregi("compose", $PHP_SELF)) { $color = "green"; } elseif (eregi("register", $PHP_SELF)) { $color = "red"; } elseif (eregi("contact", $PHP_SELF)) { $color = "yellow"; } else { $color = ""; } HTH -- Lowell Allen

« previous php.general (#168863) next »