note 87282 deleted from function.mysql-real-escape-string by danbrown
| From: | danbrown@php.net | Date: | Thu, 27 Nov 2008 19:54:03 +0000 |
| Subject: | note 87282 deleted from function.mysql-real-escape-string by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147052@lists.php.net to get a copy of this message | ||
Note Submitter: jeswanth AT gmail dot com
----
Hi for all those who are worried about sql injections they can use preg_match_all function. I always
do the same. for example
if(!preg_match_all("/^[a-zA-Z0-9]{4,20}+$/", $_POST['user_name'], $message)){
echo "<p><font color=red size=4>Username is Illegal</font></p>";
include 'index.php';
die;
}
else {
$get_user = $_POST['user_name'];
}
Hope this helps some one.