Absolute links

I am fairly new to PHP so I know what I want to do but can’t do it. I am developing a website the has five directories with an index.php at the root.

I want to have one nav.php include for the navigation menu. I know there is a way in PHP to “fake” absolute links, but I can’t figure it out.

Any help would be appreciated.

Never mind, I figured it out.

I made a statement in the head tag:

<?php $getPath = "http://www.domain.com/"; ?>

Then called the variable in front of each href= and src= tag:

<?php echo $getPath; ?>
Sponsor our Newsletter | Privacy Policy | Terms of Service