note 93005 added to function.mysql-real-escape-string
| From: | alan_a_williams | Date: | Wed, 19 Aug 2009 11:17:04 +0000 |
| Subject: | note 93005 added to function.mysql-real-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159630@lists.php.net to get a copy of this message | ||
Just a little something I like to use....
$_GET = array_map('trim', $_GET);
$_POST = array_map('trim', $_POST);
$_COOKIE = array_map('trim', $_COOKIE);
$_REQUEST = array_map('trim', $_REQUEST);
if(get_magic_quotes_gpc()):
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
$_REQUEST = array_map('stripslashes', $_REQUEST);
endif;
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
$_REQUEST = array_map('mysql_real_escape_string', $_REQUEST);
Seems to do the trick ALOT of the time, but I'm going to be honest, it can be a cunt sometimes
>_>
----
Server IP: 92.48.74.199
Probable Submitter: 92.235.184.150
----
Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php
Edit -- https://master.php.net/note/edit/93005
Del: integrated -- https://master.php.net/note/delete/93005/integrated
Del: useless -- https://master.php.net/note/delete/93005/useless
Del: bad code -- https://master.php.net/note/delete/93005/bad+code
Del: spam -- https://master.php.net/note/delete/93005/spam
Del: non-english -- https://master.php.net/note/delete/93005/non-english
Del: in docs -- https://master.php.net/note/delete/93005/in+docs
Del: other reasons-- https://master.php.net/note/delete/93005
Reject -- https://master.php.net/note/reject/93005
Search -- https://master.php.net/manage/user-notes.php