Using PHP to identify the folder the page is in?
Posted: Sat Mar 25, 2006 5:49 pm
Sorry this is a long post, in short: Is it possible to get PHP to identify the folder a page sits in?
I have a header.php page which has tabs on it as a menu system, this page is loaded into all other PHP pages when they load. When a person goes to the different areas (i.e. Information, Search) the tab for the area needs to update so that it is highligted.
Rather than having the coding on every page and setting the tabs to update manually, does anyone know of a way to get the master page, which the header is loaded into, to be able to detect which folder it sits in (i.e. /information/ or /search/ ) which I can then use to update the header page with, reflecting which tab should be selected.
The trouble with putting the header page into each page seperatly, rather than loading from an external document, is that when i make changes I have to update every page on the site!!!
Any advice would be really appreciated, sorry for the long post!
I have a header.php page which has tabs on it as a menu system, this page is loaded into all other PHP pages when they load. When a person goes to the different areas (i.e. Information, Search) the tab for the area needs to update so that it is highligted.
Rather than having the coding on every page and setting the tabs to update manually, does anyone know of a way to get the master page, which the header is loaded into, to be able to detect which folder it sits in (i.e. /information/ or /search/ ) which I can then use to update the header page with, reflecting which tab should be selected.
The trouble with putting the header page into each page seperatly, rather than loading from an external document, is that when i make changes I have to update every page on the site!!!
Any advice would be really appreciated, sorry for the long post!