php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #17081 $_GET != $HTTP_GET_VARS
Submitted: 2002-05-07 15:58 UTC Modified: 2002-05-17 13:33 UTC
From: adam at mobile dot net dot pl Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.0 OS: RH 7.2
Private report: No CVE-ID: None
 [2002-05-07 15:58 UTC] adam at mobile dot net dot pl
There is a problem with $_GET and $HTTP_GET_VARS. In documentation, in Predefined Variables is mentioned:

"$HTTP_GET_VARS contains the same information, but is not an autoglobal."

That's true only in one condition - when we are talking about REAL variables passed by GET. But when we set one variable explicity in $HTTP_GET_VARS it is doesn't set in $_GET and vice versa, ie:

$HTTP_GET_VARS["sthnew"] = "some str";
echo $_GET["sthnew"]; // There is no such index

And:

$_GET["sthnew"] = "some str";
echo $HTTP_GET_VARS["sthnew"]; // There is no such index

but !!

$HTTP_SESSION_VARS["sthnew"] = "some str";
echo $_SESSION["sthnew"]; // Everything is OK

I know that _GET and HTTP_GET_VARS shouldn't be set explicity, but I'm doing sth like URL coding and decoding to hide variables from being watched by users and I'm coding also session id. After decoding I write session sid in HTTP_GET_VARS and call session_start(). But session_start() use _only_ $_GET array, not $HTTP_GET_VARS and of course sessions doesn't work. 

I think you should change documentation or change this feature :) When I read: "$HTTP_GET_VARS contains the same information..." it means for me THE SAME ALL THE TIME... If it doesn't it is very confusing :( Especially that $_SESSION and $HTTP_SESSION_VARS contains the same information all the time.

Adam

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-07 17:10 UTC] derick@php.net
This is not really a bug, making this a documentation issue.

Derick
 [2002-05-17 13:33 UTC] tom@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 15:01:29 2024 UTC