note 100784 deleted from security.database.sql-injection by danbrown

From: Date: Sat, 06 Nov 2010 15:02:07 +0000
Subject: note 100784 deleted from security.database.sql-injection by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-173814@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- Before executing the mysql sentence you can verity your input data like this: <?php function valid_text($text){ $valid_char="abcdefghijklmnopqrstuv wxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_. "; $ valid_text =true; for ($i=0;$i<strlen($text);$i++){ if (strpos($valid_char, substr($text,$i,1))===false){ $ valid_text =false; break; } } return($valid_text); } ?>

« previous php.notes (#173814) next »