Jump to content

Navigation(menu) question


kevinritt

Recommended Posts

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

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...

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.