note 62076 rejected from function.addslashes by nlopess
| From: | nlopess@php.net | Date: | Sun, 19 Feb 2006 00:31:12 +0000 |
| Subject: | note 62076 rejected from function.addslashes by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-104007@lists.php.net to get a copy of this message | ||
Note Submitter: forgotten00 at gmail dot com
----
Would this be safe from a MySQL Injection Attack?
<?php
function cleanAll () {
foreach($_POST as $key => $val) { $_GET[$key] = stripslashes(strip_tags(htmlspecialchars($val,
ENT_QUOTES))); $$key = $val; }
foreach($_GET as $key => $val) { $_GET[$key] = stripslashes(strip_tags(htmlspecialchars($val,
ENT_QUOTES))); $$key = $val; }
}
?>
Then calling that function on every page with a login?