note 87282 added to function.mysql-real-escape-string
| From: | jeswanthATgmaildotcom at osu1 dot php dot net | Date: | Thu, 27 Nov 2008 18:45:54 +0000 |
| Subject: | note 87282 added to function.mysql-real-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-147051@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 59.162.86.33
Probable Submitter: 59.93.118.111
----
Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php
Edit -- https://master.php.net/note/edit/87282
Del: integrated -- https://master.php.net/note/delete/87282/integrated
Del: useless -- https://master.php.net/note/delete/87282/useless
Del: bad code -- https://master.php.net/note/delete/87282/bad+code
Del: spam -- https://master.php.net/note/delete/87282/spam
Del: non-english -- https://master.php.net/note/delete/87282/non-english
Del: in docs -- https://master.php.net/note/delete/87282/in+docs
Del: other reasons-- https://master.php.net/note/delete/87282
Reject -- https://master.php.net/note/reject/87282
Search -- https://master.php.net/manage/user-notes.php