Hi,
Just beginning to use PHP and have almost no programming experience, but I found that PHP could solve my problem of getting mouseovers to "stick", but trying this with frames created another problem.
Let me explain. I'm using $PHP_SELF and a simple if / else statement to determine what page I'm on. If I'm on a given page, then the rollover image is echo'd, else, the normal image is echo'd. This lets me create one menu in PHP, include it on all my pages and whatever page you are on will be highlighted (rollover image) in the menu.
This works great on normal pages, but the owner of the site wants to use frames; a menu_frame and a content_frame. So now I'm wondering if it is possible to get the $PHP_SELF info (or any other variable which defines the path to the content) for the content_frame and pass it to the menu frame?
One possible solution that might work (if I knew how to do it), is when a link is clicked to store the link path in a variable, then to use that variable in my if / else statements. Some sample code I've been using is pasted below...Sorry if it is really ugly.
<div align="center"><img src=<?php
if ($PHP_SELF == "/test_menu2.php") {
print("/images/paw_small_on.gif");
}
else {
print("/images/paw_small_blank.gif");
}
?> width="16" height="16" name="paw_bones" align="top"> <a href="/powerbones/" class=<?php
if ($PHP_SELF == "/test_menu2.php") {
print("navon");
}
else {
print("nav");
}
?> onMouseOver="MM_displayStatusMsg('Information About Zuke\'s PowerBones');MM_swapImage('paw_bones','','/images/paw_sml.gif',1);return document.MM_returnValue" onMouseOut="MM_swapImgRestore()">Power Bones</a></div>
In the above example I've used $PHP_SELF in if / else statements for both mouseovers and CSS classes.
The tedious, non-PHP version of the site is at http://www.zukes.com/