Estoy haciendo una pagina en la cual el usuario interactua constantemente con la base de datos. Tengo miedo de que me cause problemas en un futuro.
Un amigo me paso este codigo, pero estoy intranquilo, quiero saber si es suficiente o se puede perfeccionar mas
Código PHP:
function antisqlinyection($theValue,$longitudmax) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
$theValue = strip_tags($theValue);
$theValue = substr($theValue, 0, $longitudmax);
$theValue = htmlentities($theValue);
return $theValue;
}