RE: [PHP] Getting php directory
| From: | Matthias Endler | Date: | Fri, 13 Oct 2000 20:30:42 +0000 |
| Subject: | RE: [PHP] Getting php directory | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20075@lists.php.net to get a copy of this message | ||
This should do the job:
$path = substr($HTTP_SERVER_VARS['PATH_TRANSLATED'], 0,
strrpos($HTTP_SERVER_VARS['PATH_TRANSLATED'],"\\"));
Matthias aka Matthew
--
$ [ Where is Jimmy Hoffa?
[: missing `]´
> -----Original Message-----
> From: Todd Cary [mailto:todd@aristesoftware.com]
> Sent: Friday, October 13, 2000 9:30 PM
> To: php-general@lists.php.net
> Subject: [PHP] Getting php directory
>
>
> Is there a varaable that will give me the directory in which the script
> is execting?
>
> For example, my scripts are in
>
> c:\webroot\test\php
>
> If I am executing the Welcome.php script and use the
> $HTTP_SERVER_VARS["PATH_TRANSLATED"] item,
> I get
>
> c:\webroot\test\php\welcome.php
>
> I would like to just get c:\webroot\test\php.
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> todd@aristesoftware.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>