December 9, 200817 yr i am trying to set up a menu that states the current state of a link and using the following code unfortunately because i have included folders this does not work it only works if i just have the name of the file - but they are all called index.php. Could somebody advise me on what i can do <?php $currentPage = basename($_SERVER['SCRIPT_NAME']); ?> <div id="tabmenu"> <ul class="menutab"> <li<?php if ($currentPage == '../index.php') {echo ' id="selected"';} ?>><a href="../" title="home page">Home</a></li> <li<?php if ($currentPage == '../information/index.php') {echo ' id="selected"';} ?>><a href="../information/" title="General Information">General Information</a></li> <li<?php if ($currentPage == '../beforedeparture/index.php') {echo ' id="selected"';} ?>><a href="../beforedeparture/" title="Before You Go">Before You Go</a></li> <li<?php if ($currentPage == '../essentials/index.php') {echo ' id="selected"';} ?>><a href="../essentials/" title="Essentials">Essentials</a></li> </ul>
Create an account or sign in to comment