| Bug #14734 | new superglobals ($_SERVER, etc.) not documented | ||||
|---|---|---|---|---|---|
| Submitted: | 28 Dec 2001 9:31am UTC | Modified: | 11 Mar 2002 8:56pm UTC | ||
| From: | abraham_guyt at bigfoot dot com | Assigned to: | |||
| Status: | Closed | Category: | Documentation problem | ||
| Version: | 4.1.0 | OS: | Win XP | ||
| Votes: | 1 | Avg. Score: | 5.0 ± 0.0 | Reproduced: | 1 of 1 (100.0%) |
| Same Version: | 1 (100.0%) | Same OS: | 1 (100.0%) | ||
[28 Dec 2001 9:31am UTC] abraham_guyt at bigfoot dot com
[28 Dec 2001 9:34am UTC] rasmus@php.net
Then don't turn register_globals off. Turning off register_globals gets rid of all the globals. If you still want some, leave it turned on, but simply set your variables_order directive in your php.ini file to reflect which globals you want. For example, if you want environment and server variables, set it to "ES"
[28 Dec 2001 9:56am UTC] mfischer@php.net
The correct way would be to use $_SERVER['PHP_SELF'] ; this is guaranteed to work with and without register_globals = off.
[28 Dec 2001 10:01am UTC] abraham_guyt at bigfoot dot com
Hi All, Thanks for the replies. The docs tell me that using globally registered vars presents a security risk and is being turned off in future versions anyway, so it's quite necessary to get accustomed to it. Using $_SERVER['PHP_SELF'] must be the way to go. However, where to find proper documentation on these 'new' vars ? I can't find them, only some pages mentioning they exist..
[28 Dec 2001 10:05am UTC] mfischer@php.net
Valid point. I'm reopening this as a documentation problem.
[28 Dec 2001 10:17am UTC] goba@php.net
Just a note: in the PHP 4.1.0 phpinfo() output, all the predefined vars are printed as _SERVER and _ENV members, except PHP_SELF, it is printed alone, and not in any array. This must be corrected!
[28 Dec 2001 10:29am UTC] mfischer@php.net
It's printed in _SERVER too (apache 1.3.22/php 4.1.0).
[28 Dec 2001 11:35am UTC] goba@php.net
Tested again. Yes you are right. It would be good to have it listed only in _SERVER, as the other vars.
[4 Jan 2002 1:16am UTC] imajes@php.net
but $PHP_SELF is also a special variable, so I think also listing it out of any collection is a good thing.
[11 Mar 2002 8:56pm UTC] torben@php.net
This has been fixed in CVS. FWIW, I think that if $PHP_SELF is to be documented outside of the $_SERVER list, it should be worded carefully to prevent users wondering why $PHP_SELF isn't available in the global scope. Torben
[11 Mar 2002 8:56pm UTC] torben@php.net
This has been fixed in CVS. FWIW, I think that if $PHP_SELF is to be documented outside of the $_SERVER list, it should be worded carefully to prevent users wondering why $PHP_SELF isn't available in the global scope. Torben
