Is there any advantages or disadvantages of using absolute pathnames vs. relative pathnames? The problem I'm having is when I use the php include to include an html file which has image paths in it. The file path is not always the same depending on where the file with the php include is located. Is there a way to use relative path names without knowing where the file will be located? Or should I just use absolute pathnames?
If I didn't know where the file was located then I would use absoloute pathnames. Is there another way around it? T
I don't know how to get around it. Since I want to use the same header and footer for all my pages but the pages which are including the header and footer are not all in the same directory. Any ideas?
You can use relative and start it from site root. as in /images would be root/images. Only drawback thou is when using that for a php includes command you usually have to do /home/user/etc. or /../../filename or whatever.
Is there a way in PHP to get the root directory? So you could do something link: <?php ROOT ?>/images/pic.jpg And it would work no matter where the file was at?