Tema: Seguridad
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/02/2010, 19:24
luks77
 
Fecha de Ingreso: diciembre-2007
Mensajes: 274
Antigüedad: 16 años, 4 meses
Puntos: 0
Información Seguridad

Hola a todos, tengo una gran problema.

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($theValue0$longitudmax);
 
$theValue htmlentities($theValue);

  return 
$theValue;


Bueno, muchas gracias...