I'm currently checking the users current page, and the applying a .css class to the correct menu item.
My question is, how can I do this best? Currently, I have this:
$currentpage = $_SERVER['PHP_SELF'];
if($currentpage == "/prefs.php") $active = "active";
if($currentpage == "/acc.php") $active = "active";
if($currentpage == "/forum.php") $active = "active";
<a href='acc.php' title='Sync' aria-hidden='true' class='{$active} tipTip'>
<a href='acc.php' title='Sync' aria-hidden='true' class='{$active} tipTip'>
<a href='forum.php' title='Statistics' aria-hidden='true' class='{$active} tipTip'>
But this will just add the active
class to all the anchor elements.