Bug #15478 Updated: problem referencing $_GET using a variable
| From: | pguillot at paanjaru dot com | Date: | Wed, 19 Jun 2002 19:20:51 +0000 |
| Subject: | Bug #15478 Updated: problem referencing $_GET using a variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11453@lists.php.net to get a copy of this message | ||
ID: 15478
Updated by: pguillot@paanjaru.com
Reported By: pguillot@paanjaru.com
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.1.1
New Comment:
Ahem .. sniper
Is it a joke or an automated response ?
Previous Comments:
------------------------------------------------------------------------
[2002-06-18 19:22:55] sniper@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2002-02-09 18:25:02] pguillot@paanjaru.com
It seems that it is not possible to reference the $_GET, $_POST, etc
using
a variable as in (A) :
$var_get = '_GET';
$local_get = $$var_get;
$var_http_get = 'HTTP_GET_VARS';
$local_http_get = $$var_http_get;
Now if the requested url contains &something=12
print $local_http_get['something'] . '*'; // print the string
'12*'
print $local_get['something'] . '*'; // print the string '*'
But if (B) :
$var_good=&$_GET;
$var_get = $$var_good;
print $local_get['something'] . '*'; // print the string '12*'
Would it be a problem trying to reference a variable which name starts
with an underscore ?
I use this kind of syntax to check if something not allowed exists in
the url,
using an array like $to_check = array( '_GET', '_POST' );
Anyway, as it's possible to use an alternative syntax (B), it is
not a __big__ problem, after all !
Keep on with a so nice job, I am still amazed about the power and
speed
of Php, after more than 2 years using it, in a production environment.
Thanks a lot, and have a nice day.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15478&edit=1