|
Posted by Good Man on 04/05/06 19:30
> If one file accesses it from a certain directory it works, but then if
> another file acceses it from yet another directory then it cant find
> it because the path is different !
>
> For example:
>
> the follwoing works for one of my files
>
> include(/includes/include.php');
>
>
> but for another one i have to use this because its in another part of
> the directory structure
>
> include('events/includes/include.php');
actually, i don't believe you. unless you made a typo in that first
example, using it in any other file will work.
paths that START with a / mean that they are coming from the TOP of your
server. You need to find the absolute path to your includes directory;
from what you wrote in your first example, its right at the top of your
server.
for the sake of this example, lets say your includes file was found in
the following directory (starting from the top)
"/home/username/events/includes".
if you put...
include('/home/username/events/includes/include.php');
....at the top of your PHP pages, they will all access it without a
problem.
[Back to original message]
|