RE: [PHP] Code Advice
| From: | Ernest E Vogelsinger | Date: | Wed, 06 Nov 2002 19:17:15 +0000 |
| Subject: | RE: [PHP] Code Advice | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123051@lists.php.net to get a copy of this message | ||
At 20:08 06.11.2002, Ford, Mike [LSS] spoke out and said:
--------------------[snip]--------------------
>> -----Original Message-----
>> [...snip...]
>> value, in _GET or _POST? Try this:
>> foreach ($_POST as $name => $value)
>> $_GET[$name] =& $value;
>> Your application may safely use only the $_GET array after
>> this, the POSTed
>> variables correctly overriding their GET counterparts. The
>> "=&" reference
>> is there for optimization - faster and less memory-consuming.
>
>Uh... isn't this what $_REQUEST is for??
--------------------[snip]--------------------
Yessir, exactly. However if you're going to fiddle around with $_GET
(checking for allowed input) while allowing any $_POST'ed data, you might
prefer this solution...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/