note 42471 deleted from function.mysql-escape-string by nlopess

From: Date: Tue, 18 May 2004 13:24:54 +0000
Subject: note 42471 deleted from function.mysql-escape-string by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-69760@lists.php.net to get a copy of this message
Note Submitter: phpspam at secuserv dooot ch ---- I often work with array-forms. So everything I submit is a child of the $_POST['SUBMIT'] - Array. To clean all inputs before working with it, I use the following function: function cleanArray(&$cleanMe) { function cleanElement(&$item, $key) { $item = mysql_escape_string($item); } array_walk($cleanMe, 'cleanElement'); } You may add more "checks" and cleanup-stuff into the cleanElement-Function (ex. htmlspecialchars and stuff like that).

« previous php.notes (#69760) next »