Sure thing. Hopefully you have a central include() file... that would make
this easier so you don't have to put this code in all of your pages.

if ($_SERVER['PHP_SELF'] == "blahblah.php") {
    $bgcolor = "white"; //change as needed
    $text = "blue"; //change as needed
}
else {
    $bgcolor = "blue";
    $text = "white";
}

Then just echo the statements out.

echo "<tr bgcolor=$bgcolor><td><font color=$text>blahblah</font></td></tr>\n";

I would advise using CSS instead of bgcolor elements, though, as it would
make it so much easier (<tr class=$class><td>blahblah</td></tr>).

Look up http://www.w3c.org/Style/CSS for some good tricks. Also go to
http://www.htmlhelp.com and look up Cascading Style Sheets.

-Dash

"Just out of curiosity does this actually mean something or have some
of the few remaining bits of your brain just evaporated?"
                -- Patricia O Tuama, [EMAIL PROTECTED]

On Fri, 17 Jan 2003, Wolfgang Schneider wrote:

> Hi
>
> a bit of a newbie question ... :-)
>
> Can php be used to set the bgcolor in a navigation menu depending on
> what page one is on?
> Let's say the menu consists of table with 4 cells / options, and the
> option corresponding to the current page (somehow use $php_self to
> determine?) have blue text on white background, whereas all other
> options have white text on blue background  ...
> Can someone point me in the right direction, pelase?
> Any help is much appreciated
> God bless you with His grace and peace
> Wolfgang
>
> Looking for Biblical information? COME AND SEE!
> http://classes.bibelcenter.de ...  online classes
> http://www.bibelcenter.de ... biblical studies
> www.christianbook.com/Christian/Books/home?event=AFF&p=1009812 ... Christian 
>bookstore
> http://www.christian-ebooks.de ... Christian eBooks
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to