note 31298 added to security.registerglobals
| From: | solar at heliacal dot net | Date: | Wed, 16 Apr 2003 16:47:09 +0000 |
| Subject: | note 31298 added to security.registerglobals | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46699@lists.php.net to get a copy of this message | ||
This construct is handy for getting similar functionality to having register_globals on, but being
able to selectively import variables for your form submissions.
$param_list=array(
'some_input',
'some_input2'
);
/* this will work whether it was GET or POST, doesn't make a difference */
foreach($param_list as $param)
@$$param=${"_$_SERVER[REQUEST_METHOD]"}[$param];
If you have inputs in your form with names some_input and some_input2, this snippet would have
created $some_input and $some_input2. This way you can just list all your inputs in $param_list and
only those are imported.
--
http://www.php.net/manual/en/security.registerglobals.php
http://master.php.net/manage/user-notes.php?action=edit+31298
http://master.php.net/manage/user-notes.php?action=delete+31298
http://master.php.net/manage/user-notes.php?action=reject+31298