This seems like the most basic issue in PHP, but I can't figure out the best way to do this. In short, I am working on upgrading an existing site and instead of Dreamweaver's clunky template function, am switching to PHP includes for various constant parts of the site (header, footer, main menu). What is tripping me up is a good, clean, simple way of intelligently defining relative paths, especially with the main menu. Obviously relative paths get all messed up, depending on where the file that's calling menu.php is in realtion to the root. So links that work on the home page, get messed up in pages in directories and subdirectories, and vice versa.
I'd like to stick with relative paths rather than absolute (if for no other reason than to make moving from my development server to the live server easier).
(Related, is there any way to get the includes to be similarly "intelligent", so I can essentially create on template that is smart enough for it to figure out where the file is in relation to the root to make include calls work with relative links.)
Thanks, espcially if this is such a basic question I should be ashamed in asking it.