Re: $PHP_SELF not set !
| From: | Hellekin O. Wild | Date: | Tue, 27 Nov 2001 21:28:48 +0000 |
| Subject: | Re: $PHP_SELF not set ! | ||
| References: | 1 2 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-4074@lists.php.net to get a copy of this message | ||
Finally I found out where the problem lies !
First, it was a real mistake on my part as I redefined $PHP_SELF in an auto_prepend file using getenv('PHP_SELF') because I was using register_globals OFF and didn't want to modify the whole bunch of PHP applications that I was running.
The real problem, thus is not that $PHP_SELF is not set but a problem with the getenv() function.
I updated the test script to verify what environment variables are not get using getenv().
It happens that getenv('PHP_SELF') and getenv('PATH_TRANSLATED') are not set.
The bug happens with both register_globals set to ON and OFF.
(Note : the $_SERVER['signature'] on the test page is intentionnally left blank : not a bug.)
See : http://php.hellekin.com/test/php_self.php
Sorry again for that mistake : although it caught a bug, it's probably not a critical one as the variables are accessible through other means.
*
Although it is logic not to set $PHP_SELF when register_globals is OFF, it may be a good idea to set it anyway as this is used in a majority of scripts around, don't you think ?
hellekin