Forum Moderators: coopster
As getting the current page is easy if you use javascript
[edited by: PHP_Chimp at 11:38 am (utc) on Oct. 4, 2007]
$thispage="Home";
<html>
<style>
#currentpage {
text-decoration:underline;
}
</style>
<body>
<ul><li
<?php
if ($thisPage=="Home")
echo " id=\"currentpage\"";?>>
<a href="#">Home</a>
</li></ul>
?>
</body>
</html>
------------------------
The downside is each page has to be assigned a value for $thispage. Could this be done automatically somehow with just php?
if(strpos($_SERVER['PHP_SELF'], "index.php")){
//then index.php is current
}
elseif(strpos($_SERVER['PHP_SELF'], "pagex.php")){
//then pagex is current
}
other wise if ur navigation is more dynamic, such as using "index.php?page=pagex" to navigate, u can use the $_GET['page'] to get the current page