PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

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%)
View/Vote Developer Edit Submission

Welcome! If you don't have a SVN account, you can't do anything here. You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
SVN Username: SVN Password:
Quick Fix:
Status: Assign to:
Category:
Summary:
From: abraham_guyt at bigfoot dot com
New email:
Version: OS:
New/Additional Comment:

[28 Dec 2001 9:31am UTC] abraham_guyt at bigfoot dot com
When using PHP with track_vars On and register_globals Off (recommended
setting), PHP doesn't know the built-in system and environment vars
anymore.

For example, $PHP_SELF becomes and unknow variable.

This is really annoying.
[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

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC