Posted by Michael Fesser on 06/19/07 20:23
..oO(Chuck Anderson)
>And it is also came to me just this morning that ....
>
>include "{$_SERVER['DOCUMENT_ROOT']}/file_to_include.php";
>
>... was the solution.
>
>But .... do you happen to understand why "/" does not work with include
>to indicate the root dir?
You mean something like
include '/foo.php'; ?
The document root of the webserver ($_SERVER['DOCUMENT_ROOT']) and the
root of the server's file system are two completely different things.
The above statement would look for the file in the server's physical
root directory, where no normal user should have write access - it's a
system-only area. The webserver's root directory is usually something
like '/home/username/public_html', where you can do whatever you want.
Micha
Navigation:
[Reply to this message]
|