Jump to content

Detect current page


twilitegxa

Recommended Posts

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

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.