Best way to include php files with relative links?

AshleyC

New member
I'm trying to develop my website. I have several directorys in my main directory, IE downloads, contact, software etc. Inside these directories I have php files like index.php and pagename.php etc. I also have an includes folder, inside the main (public_html) folder, with files like header.php, footer.php, and nav.php. These files, particually nav.php, the main menu, contain relative links to files inside the /public_html directory. For example, index.php is the homepage, downloads/index.php is the downloads page, software/index.php is the software page, etc. My question is, how can I include this file, in a page in a subdirectory, so that when links are clicked they are relative to the main directory? so, when clicking on the home link on say the downloads page, instead of going to the 'index.php' page in the downloads directory, I want it to go to the index.php (the main page) in the main directory.
Thanks for any help; sorry if this made no sence at all!
 
Back
Top