Re: Getting The Document Root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think my original message may have been confusing. I'll give a better example:

I have a path: /home/jeremy/public_html/test/test.php

What I want off of the path is just the "root" of the user's document root (e.g. where he stores all his publically viewable files): /home/jeremy/public_html/

Now, the document root can vary from server to server ... Like /var/www/ or /home/jeremy/www/ or whatever. So, I'd like to know if there was a way to dynamically fetch it, instead of putting together a list of the known document roots (hard-coding supported ones).

I hope that makes more sense!


Try this:

echo("<pre>");
print_r($_SERVER);
echo("</pre>");

Maybe you'll find something there.

tedd
--
--------------------------------------------------------------------------------
http://sperling.com/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux