note 87478 added to function.mysql-real-escape-string

From: Date: Sat, 06 Dec 2008 19:12:42 +0000
Subject: note 87478 added to function.mysql-real-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-147756@lists.php.net to get a copy of this message
for all those who would like to use a different solution other than the mysql_real_escape_string or related functions. PHP provides yet another powerful function. I always use this <?php if(!preg_match_all("/^[a-zA-Z0-9]{4,20}+$/", $_COOKIE['cookie'], $message)){ echo "<p><font color=red size=4>Username is Illegal</font></p>"; require 'index.php'; die; } else { $cookie = $_COOKIE['cookie']; } ?> You can use any user input in place of cookie for example post, get etc. Hope it comes useful for someone. Thank you. ---- Server IP: 59.162.86.33 Probable Submitter: 59.93.115.131 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php Edit -- https://master.php.net/note/edit/87478 Del: integrated -- https://master.php.net/note/delete/87478/integrated Del: useless -- https://master.php.net/note/delete/87478/useless Del: bad code -- https://master.php.net/note/delete/87478/bad+code Del: spam -- https://master.php.net/note/delete/87478/spam Del: non-english -- https://master.php.net/note/delete/87478/non-english Del: in docs -- https://master.php.net/note/delete/87478/in+docs Del: other reasons-- https://master.php.net/note/delete/87478 Reject -- https://master.php.net/note/reject/87478 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#147756) next »