note 87478 deleted from function.mysql-real-escape-string by aidan
| From: | aidan@php.net | Date: | Sun, 24 May 2009 19:41:33 +0000 |
| Subject: | note 87478 deleted from function.mysql-real-escape-string by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155930@lists.php.net to get a copy of this message | ||
Note Submitter: jeswanth at gmail
----
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.