Hi I had somthing like the following in my code which almost works but code
use debugging!

<tr bgcolor=" <? IF(?page!="home") { print("#006633") ; }
                    elseif (?page!="compose") { print("#009966") ; }
                    elseif (?page!="Registration") {print("#CC0033") ;}">
<td><td/>
<tr/>

But what would happen a totally different colour would show

In the above example would I assing the variable as such <tr
bgcolor="$color">
"Lowell Allen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > 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

Reply via email to