note 27773 deleted from function.get-magic-quotes-gpc by aidan
| From: | aidan@php.net | Date: | Tue, 06 Jul 2004 06:20:45 +0000 |
| Subject: | note 27773 deleted from function.get-magic-quotes-gpc by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72701@lists.php.net to get a copy of this message | ||
Note Submitter: dfs@roaringpenguin.com
----
Rather than trying to fix up the post and get variable arrays, I prefer to wrap all my form access
methods in functions:
function getval ($key) {
global $HTTP_GET_VARS;
if ((get_magic_quotes_gpc()) {
return stripslashes($HTTP_GET_VARS[$key]);
}
return $HTTP_GET_VARS[$key];
}
This has the added benefit of requiring a change in only one place if (when?) the PHP team decides
to change yet again the method for accessing form variables. :-)