Forums

This topic is locked

Nav Bar Button

Posted 01 Nov 2007 17:15:08
1
has voted
01 Nov 2007 17:15:08 john culp posted:
In a nav bar, I want the button that leads to a page to show it's "over" state when that page is displayed, and to lose it's link ability... in other words to be static if the page it links to is already displayed. I tried adding the following but for some reason the php code doesn't even show in Dreamweaver. In other words, there should be a yellow box in between the navbar elements, but there is not, and the code doesn't work. I tried putting some test php code in another spot on a page based on this template,and it showed fine.

<?php if ($_SERVER['REQUEST_SELF']=="/index.html"{?>
<td><img src="../Buttons/main/home_b.jpg" /></td>
<?php }else{?>
<td><a href="../index.html" target="_top" onClick="MM_nbGroup('down','group1','homepage','../Buttons/main/home.jpg',1)" onMouseOver="MM_nbGroup('over','homepage','../Buttons/main/home_b.jpg','../Buttons/main/home_b.jpg',1)" onMouseOut="MM_nbGroup('out')"><img name="homepage" src="../Buttons/main/home.jpg" border="0" alt="Beaver Manufacturing Homepage" onLoad="" /></a></td>
<?php } ?></tr>

Replies

Replied 01 Nov 2007 17:30:19
01 Nov 2007 17:30:19 john newsome replied:
can you post all the code for this page so i can take a look. at first glance it seems you are looking at an index page with an extention of html. when running php the extention needs to be php.

<?php if ($_SERVER['REQUEST_SELF']=="/index.html"{?
Replied 01 Nov 2007 18:08:43
01 Nov 2007 18:08:43 john newsome replied:
try this

<?php if ($_SERVER['REQUEST_SELF']=="/index.html"{?>
change this line to
<?php if ($_SERVER[PHP_SELF]=="/index.php"{?>

the index file must be a php file
Replied 01 Nov 2007 18:13:18
01 Nov 2007 18:13:18 john culp replied:
Got it. Finally beat it into submission. Thanks!

Reply to this topic