Re: Getting The Document Root
| From: | Richard Lynch | Date: | Thu, 02 Feb 2006 20:54:30 +0000 |
| Subject: | Re: Getting The Document Root | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229764@lists.php.net to get a copy of this message | ||
On Thu, February 2, 2006 7:14 am, Jeremy Privett wrote:
> I'm looking for a method that would be able to extract the user's true
> document root (e.g. /home/jeremy/public_html/) so that I can use it
> for
> some filesystem scanning functions. I'm trying to avoid hard-coding
> supported document roots in favor of being able to dynamically detect
> it, but nothing is coming to mind. I thought I would consult some of
> the
> minds of the mailing list for advice. Any ideas or code would be
> greatly
> appreciated.
What you want is in the output from:
<?php phpinfo();?>
Just search for the directory on your site that you know is correct,
and figure out which variables you need to get that.
--
Like Music?
http://l-i-e.com/artists.htm