kevinritt Posted April 17, 2009 Share Posted April 17, 2009 I'm not sure if this doable or not. Is there a way to disable the link of the page that you are currently on using PHP. For example, if I have three links: Home-About-Contact and someone is on the Contact page, is it possible to disable the Contact link but when they're on another page the Contact link works but the current page (Home for example) is now disabled. I hope this makes sense. Thank you Link to comment https://forums.phpfreaks.com/topic/154491-navigationmenu-question/ Share on other sites More sharing options...
sloth456 Posted April 17, 2009 Share Posted April 17, 2009 yeah, just don't make it a link. So in home.php or whatever your home page file is your menu would look like Home <a href="about.php">About</a> <a href="contact.php">Contact</a> Link to comment https://forums.phpfreaks.com/topic/154491-navigationmenu-question/#findComment-812302 Share on other sites More sharing options...
mtoynbee Posted April 17, 2009 Share Posted April 17, 2009 Does this give you an idea? $contactLink = '/contactus.php'; echo $contactLink==$_SERVER['PHP_SELF']?"<a href=\"#\">Contact Us</a>":"<a href=\"".$contactLink."\">Contact Us</a>"; You can vary styles for the two options so one is "grayed out" or highlighted in another way... Link to comment https://forums.phpfreaks.com/topic/154491-navigationmenu-question/#findComment-812304 Share on other sites More sharing options...
kevinritt Posted April 17, 2009 Author Share Posted April 17, 2009 I think this may work: if ($PHP_SELF == "/contact.php" ) { $pageTitle = "Contact Us for more information"; $contact = "contact"; } else { $contact = '<a href="contact.php">Contact Us</a>'; } Link to comment https://forums.phpfreaks.com/topic/154491-navigationmenu-question/#findComment-812319 Share on other sites More sharing options...
mtoynbee Posted April 17, 2009 Share Posted April 17, 2009 Looks like the same logic to me... Link to comment https://forums.phpfreaks.com/topic/154491-navigationmenu-question/#findComment-812326 Share on other sites More sharing options...
kevinritt Posted April 17, 2009 Author Share Posted April 17, 2009 Looks like the same logic to me... Yep, just checking Link to comment https://forums.phpfreaks.com/topic/154491-navigationmenu-question/#findComment-812492 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.