Hey guys,
This is usually my last resort when I get stuck on a problem and here I am, yet again, stuck.
I'm trying to use php to indicate the current page you are on by having a tab with white text while all others have blue.
I was thinking a simple if else type statement would work but I think I'm getting the syntax all wrong.
<div id="nav">
<?php $currentPage = basename($_SERVER['SCRIPT_NAME']); ?>
<a href="<img src="img/home_on.jpg" alt="Home" />
<a href="articles.php"> <?php if ($currentPage == 'index.php') {echo '<img src="img/articles_on.jpg"';} ?> <img src="img/articles_off.jpg" class="domroll img/articles_on.jpg" alt="Articles" /></a>
The logic seems simple enough to me. If $currentPage == 'index.php" then echo the on image. How do i impliment an else (display the off image)?
Does this make any sense? I'm sure there are a ton of easier ways to do this, one of which is not use images for the navigation.
<img src="img/gallery_off.jpg" class="domroll img/gallery_on.jpg" alt="Gallery" />
<img src="img/directory_off.jpg" class="domroll img/directory_on.jpg" alt="Directory" />
<img src="img/churches_off.jpg" class="domroll img/churches_on.jpg" alt="Churches" />
<img src="img/contact_off.jpg" class="domroll img/contact_on.jpg alt="Contact" /></div>
<div id="mainpic"></div>
Thanks!