A ways back I started using include() to help me manage the content of my pages - notably the navigation bar.
I wanted to get your thoughts on how to create relative links in the header file, even when you have multiple levels on your site.
For those of you who don't understand what I'm getting at, imagine you have a header file that contains your nav bar:
// header.php
<a href="about.php">About Us</a> | <a href="contact.php">Contact Us</a> | <a href="http://www.chick.com">Not what you'd expect</a>
Now, I'm going to include() that on all my pages. It works fine on index.php but if I put it on users/profiles/index.php all of the relative links no longer work.
I could pass a GET variable through the function, include("../../header.php?deep=2"); that would tell my header to prepend all links with "../../" - but that's the best way I can think of doing it.
Does anyone have any suggestions about how to use headers to include navigation bars with relative links more effectively?
Thanks.