Re: $_POST Array and Cleaning
| From: | Nathan Nobbe | Date: | Mon, 21 Jan 2008 02:25:50 +0000 |
| Subject: | Re: $_POST Array and Cleaning | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267733@lists.php.net to get a copy of this message | ||
On Jan 20, 2008 9:22 PM, nihilism machine <nihilismmachine@gmail.com> wrote:
> I'm trying to create a function that will first take an array of
> $_POSTs and give them key/value pairs like variables. For instance, if
> i had $_POST['whatever'] = "whatever", that would be made into
> $whatever = "whatever", then i can clean for sql injection and xss.
> any ideas here?
>
foreach($_POST as $curPostKey => $curPostVal) {
cleanPost($curPostKey); // <-- todo: implement me
$$curPostKey = $curPostVal;
}
-nathan