RE: [PHP-INST] Problem: PHP_SELF variable
| From: | Mark Roedel | Date: | Fri, 26 Oct 2001 14:40:57 +0000 |
| Subject: | RE: [PHP-INST] Problem: PHP_SELF variable | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-4762@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Hostmaster [mailto:hostmaster@dov.net]
> Sent: Friday, October 26, 2001 3:23 AM
> To: php-install@lists.php.net
> Subject: [PHP-INST] Problem: PHP_SELF variable
>
>
> does anyone know why my $PHP_SELF shows the full path
> and not only the name of the script? Something wrong
> with my php.ini? Thanks in advance for answers.
The manual, at
http://www.php.net/manual/en/language.variables.predefined.php
Says that the value returned in $PHP_SELF is "relative to the document
root"...that'd imply to me that it's intended to include path
information from your server's document root on down, and I don't think
I've ever specifically seen it do otherwise.
If all you want is the actual name, without any path information at all,
perhaps the basename() function would be helpful?
---
Mark Roedel | "Blessed is he who has learned to laugh
Systems Programmer | at himself, for he shall never cease
LeTourneau University | to be entertained."
Longview, Texas, USA | -- John Powell