Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/02/2010, 13:28
Avatar de JessicaTJ
JessicaTJ
 
Fecha de Ingreso: enero-2007
Ubicación: 127.0.0.1
Mensajes: 472
Antigüedad: 18 años, 1 mes
Puntos: 25
Respuesta: Restringir html y javascript en php

Puedes usar una funcion para hacer seguro lo ke introducen, por ejemplo:

Código PHP:
function make_safe($variable) {
    
$variable htmlentities($variableENT_QUOTES);
      if (
get_magic_quotes_gpc()) { 
       
$variable stripslashes($variable); 
    }
      
$variable mysql_real_escape_string(trim($variable));
     
$variable strip_tags($variable);
    
$variable str_replace(""""$variable);
     return 
$variable;

Y al meter las variables, las llamas asi:
Código PHP:
make_safe($_POST['variable']); 
__________________
٩(͡๏̯͡๏)۶ || ٩(͡๏̯͡๏)۶