Hi,
I'm running into an issue when I'm including my header.php and footer.php into my web pages. The problem is that for each web page I have to specify how far back into the directory the page needs to go to reach header and footer.
Example: Includes for a page located in http://mysite.x10hosting.com/dev/index.php
Where header.php and footer.php are located at http://mysite.x10hosting.com/
What I would like to do(and thought would work for getting back to the root directory) is this:
Unfortunately when I attempt to run a page using the 2nd method there I get an error saying that "/header.php could not be found in the directory /dev/index.php".
Any help would be very much appreciated. It's such a bother to have to look and see how many directories back I need to go in order for my includes to reach the main directory and grab those damned header/footer files...
Thank you,
Jeeter
I'm running into an issue when I'm including my header.php and footer.php into my web pages. The problem is that for each web page I have to specify how far back into the directory the page needs to go to reach header and footer.
Example: Includes for a page located in http://mysite.x10hosting.com/dev/index.php
Where header.php and footer.php are located at http://mysite.x10hosting.com/
PHP:
<?php include('../header.php'); ?>
/*Body*/
<?php include('../footer.php'); ?>
What I would like to do(and thought would work for getting back to the root directory) is this:
PHP:
<?php include('/header.php'); ?>
/*Body*/
<?php include('/footer.php'); ?>
Unfortunately when I attempt to run a page using the 2nd method there I get an error saying that "/header.php could not be found in the directory /dev/index.php".
Any help would be very much appreciated. It's such a bother to have to look and see how many directories back I need to go in order for my includes to reach the main directory and grab those damned header/footer files...
Thank you,
Jeeter