Posted by Chuck Anderson on 06/19/07 21:04
Michael Fesser wrote:
> .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
>
Thanks. I get it. This one always gets me (maybe no longer now). I have
always gotten it confused with hyperlinks (where / *is* the web root).
--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*****************************
Navigation:
[Reply to this message]
|