note 87907 rejected from function.mysql-real-escape-string by thiago

From: Date: Tue, 30 Dec 2008 13:21:32 +0000
Subject: note 87907 rejected from function.mysql-real-escape-string by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148674@lists.php.net to get a copy of this message
Note Submitter: enlaces at exolimpo dot com ---- Can someone check this function and tell me how it works? I wanted it to protect from mysql injections... you can email me if you think its a good function.. or if you have some thoughts about it. function safe_input(&$string){ if(is_array($string)) foreach($string as $key => $valor) $string[$key] = safe_input($valor); else $string = trim( strip_tags( htmlspecialchars( addcslashes( mysql_real_escape_string($string),';%_:$&?-+=*[|]()' ) ,0,'UTF-8') ) );

« previous php.notes (#148674) next »