note 68979 added to function.mysql-escape-string

From: Date: Thu, 17 Aug 2006 22:37:03 +0000
Subject: note 68979 added to function.mysql-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-116030@lists.php.net to get a copy of this message
We need to distribute code compatible with as many servers as possible. We use this little function on user submitted data: // http://php.net/mysql_escape_string used for wider isp host support - start if(!function_exists('escape_smart')){ // Quote variable to make safe function escape_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not integer if (!is_numeric($value)) { $value = mysql_escape_string($value); } return $value; } } ---- Server IP: 216.235.15.211 Probable Submitter: 24.68.66.65 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-escape-string.php Edit -- https://master.php.net/note/edit/68979 Del: integrated -- https://master.php.net/note/delete/68979/integrated Del: useless -- https://master.php.net/note/delete/68979/useless Del: bad code -- https://master.php.net/note/delete/68979/bad+code Del: spam -- https://master.php.net/note/delete/68979/spam Del: non-english -- https://master.php.net/note/delete/68979/non-english Del: in docs -- https://master.php.net/note/delete/68979/in+docs Del: other reasons-- https://master.php.net/note/delete/68979 Reject -- https://master.php.net/note/reject/68979 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116030) next »