Jeremy Privett wrote:
John Nichel wrote:

$_SERVER['DOCUMENT_ROOT']
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server


Nope. I've already tried that... $_SERVER['DOCUMENT_ROOT'] contains /home/jeremy/public_html/test/ ... All I want is to the public_html part.


'DOCUMET_ROOT' will return what the web server's document root is, no matter what directory on that web server the script is run.

ie, I'm running apache, look here....

http://www.nichel.net/docroot.php
http://www.nichel.net/test/docroot.php
http://www.nichel.net/bob/docroot.php
http://www.nichel.net/bob/fred/docroot.php

All four of those 'docroot.php' scripts are the same:

<?php


echo ( $_SERVER['DOCUMENT_ROOT'] );


?>

But they're in four different directories. Document root is just that, it's the directory where Apache (or other web servers) start serving files from for the particular domain.

Either you're webserver is seriously hosed (I can't even imagine how), or document root is not what you're thinking it is. If you place a script three levels below the 'test' directory which echo's out document root, what's the output?

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to