note 62076 added to function.addslashes

From: Date: Sun, 19 Feb 2006 00:19:44 +0000
Subject: note 62076 added to function.addslashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-104006@lists.php.net to get a copy of this message
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? ---- Server IP: 216.235.15.211 Probable Submitter: 64.180.189.140 ---- Manual Page -- http://www.php.net/manual/en/function.addslashes.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+62076 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62076&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62076&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62076&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62076&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62076&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62076&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62076&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+62076&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#104006) next »