Hi,
The way my website is currently set up is as this; Each page starts with an include which includes header.php and ends with another include, including footer.php. These two files basically contain code common to each page (ie. the nav bar round the side) and the actual code for each page goes inbetween these 2 includes.
These two include files are in a /Common directory in the root of my site along with the associated images needed for the nav bar etc.
So, my problem is... What is the best way to determine the path of where the common/images directory is in terms of the page including the header and footer files.
I hope I have explained this OK. My basic problem is that if, for example, the page including the header/footer code is /Gallery/Users/index.php the path to the common dir will be "../Common/" whereas if the file is in the root dir the path will just be "Common/".
I have tried including a $CommonPath var in every page, containing the correct path to the common dir for that page but this seems a little inefficient/cumbersome.
Has anyone got any suggestions to improve this situation? I imagine its a common problem? Or is my approach to including portions of code not the prefered way?
Thanks!
Russ.