is $PHP_SELF equal to $page?
Can somebody please tell me how I can get this to work?
It should compare the active link with the button's link then display the button accordingly.
This file is 'included' in every page.
CODE:
function header ()
{
<div <?if ($PHP_SELF == $thisPage){echo "class=\"activeLink\"";} else { ?> class="button" onMouseOver="this.style.background='#FFFFFF'; this.style.border='1px dashed #000000'" onMouseOut="this.style.background='#CCCCFF'; this.style.border='1px solid #CCCCFF'"<?}?>>
Home
</div>
<!--Insert other buttons here-->
}
Huh? What does $thisPage equal?
$thisPage = "index.php";
...or whatever page the button links to.
I know this button doesn't go anywhere; normally it has an anchor either side of "Home".
Even if you replace $thisPage with "index.php", $PHP_SELF doesn't seem to equal it when the file is index.php.
That is because PHP self would return the path of the page. ie. /path/to/index.php or, if index.php is in the root directory, /index.php. Note the preceding slash.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks