twilitegxa Posted September 24, 2008 Share Posted September 24, 2008 Is there a way to use PHP to detect the current page and somehow show what the current page is in the navigation links? Currently I have a separate php file for my navigation menu included with each page. I used to have it placed on each page (the entire code, I mean), and use CSS to show which page was gthe current one by using a class, and then assigning the class a style that made the link underlined and a different color. What I'm wondering is, is there a way to somehow do something similar with PHP? Since I have the menu in a separate PHP file, I can no longer utilize the CSS I was previously using (since the menu is the same for each page now, whereas before I changed the class for each link on each individual page). Please, any help on this would be greatly appreciated! Link to comment https://forums.phpfreaks.com/topic/125693-detect-current-page/ Share on other sites More sharing options...
phoenixx Posted September 24, 2008 Share Posted September 24, 2008 Try this link to show three examples depending on what you want to show. http://www.webcheatsheet.com/PHP/get_current_page_url.php Link to comment https://forums.phpfreaks.com/topic/125693-detect-current-page/#findComment-649933 Share on other sites More sharing options...
twilitegxa Posted September 25, 2008 Author Share Posted September 25, 2008 Is there a way to use one of those examples, or another example maybe, though, to show what link in my navigation menu they have selected? Or would a breadcrumb trail inserted manually be my only other option? Link to comment https://forums.phpfreaks.com/topic/125693-detect-current-page/#findComment-650040 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.