Re: Getting The Document Root

From: Date: Thu, 02 Feb 2006 17:18:57 +0000
Subject: Re: Getting The Document Root
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-229743@lists.php.net to get a copy of this message
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/

« previous php.general (#229743) next »