> 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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php