Bug #17081 Updated: $_GET != $HTTP_GET_VARS
| From: | derick@php.net | Date: | Tue, 07 May 2002 21:10:04 +0000 |
| Subject: | Bug #17081 Updated: $_GET != $HTTP_GET_VARS | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-7177@lists.php.net to get a copy of this message | ||
ID: 17081
Updated by: derick@php.net
Reported By: adam@mobile.net.pl
Status: Open
-Bug Type: Scripting Engine problem
+Bug Type: Documentation problem
Operating System: RH 7.2
PHP Version: 4.2.0
New Comment:
This is not really a bug, making this a documentation issue.
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-05-07 15:58:11] adam@mobile.net.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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17081&edit=1