how to add class dynamically in navigation links with php? -
i have php function change css class dynamically on navigation link came error! notice: undefined variable: menulinkid in c:\xampp\htdocs\includes\vertical_menu.php on line 9 has idea why?
<?php $index="menu-items"; $topalbums="menu-items"; $topartists="menu-items"; $toplists="menu-items"; $charts="menu-items"; $memulinkid=basename($_server['php_self'],".php"); if($menulinkid=="index"){ $index='active'; }else if ($memulinkid=="topalbums"){ $topalbums='active'; }else if ($memulinkid=="topartists"){ $topartists='active'; }else if ($memulinkid=="toplists"){ $toplists='active'; }else if ($memulinkid=="charts"){ $charts='active'; } ?>
you wrote $memulinkid
, not $menulinkid
in definition. (a line above error).
Comments
Post a Comment