07-07-2010, 06:40 PM
|
#2 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
The best way to make sure the right path is used, is to provide an absolute one. Commonly that means using something like __DIR__ (or dirname(__FILE__) if you're not blessed with being able to use PHP 5.3 yet) to get the absolute path to the file the constant is written in.
For example, inside your head.php file:
PHP Code:
include __DIR__ . '/../Admin/Docs/head.txt';
If the path to head.php was /home/path/to/site/includes/head.php then __DIR__ would be /home/path/to/site/includes. That would make the included file be located at /home/path/to/site/includes/../Admin/Docs/head.txt which is just the same as /home/path/to/site/Admin/Docs/head.txt.
With that, you would continue including the head.php as you are and the path would always be correct for the head.txt file.
|
|
|
|