/ Published in: PHP
Directory = $thisSection. Page file name = $thisPage.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Directory = $thisSection Page file name = $thisPage */ $thisSection = ($thisSection == "") ? "home" : $thisSection; // From there you can do things like: function subnav($name,$page) { global $thisPage; if($thisPage==$page) { echo '<li class="active"><a href="'.$page.'.php">'.$name.'</a></li>'; } else { echo '<li><a href="'.$page.'.php">'.$name.'</a></li>'; } } if($thisSection=="about") { subnav("About Us", "about"); subnav("History", "history"); subnav("Contact Us", "contact"); }