Doing a quick scan through the output of phpinfo() on my machine, I can see
any one of the following will give me the path (incl. filename of the
current script)

$HTTP_SERVER_VARS["DOCUMENT_ROOT"] . $PHP_SELF
$HTTP_SERVER_VARS["SCRIPT_FILENAME"]
$HTTP_SERVER_VARS["PATH_TRANSLATED"]

HTH
Martin

-----Original Message-----
From: Jeff [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 3:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Where am I?


No, I've been looking all day. I can get the information is I run the script
from the root, but what if I am in a sub-dir?
Jeff

"Martin Towell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> try doing a phpinfo() , somewhere in there it'll tell you
>
> Martin
>
> -----Original Message-----
> From: Jeff [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 18, 2002 2:34 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Where am I?
>
>
> I'm using PHP 4.0.6. I am developing on Win98SE, and deployed on an Apache
> server.
>
> I need to find the actual path of the root directory.
>
> Windows: C:/Inetpub/wwwroot/
> Apache: /home/dcent/public_html/
>
> I've tried dirname(), basename(), etc. I just can't figure it out.
> Help.
>
> Jeff
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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

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

Reply via email to