Ver Mensaje Individual
  #15 (permalink)  
Antiguo 05/05/2008, 11:51
Avatar de seik!
seik!
 
Fecha de Ingreso: mayo-2006
Mensajes: 492
Antigüedad: 18 años
Puntos: 6
Re: ¿como detener inyeccion sql?

siempre depuren un poko mas sus variables...

pueden recorren buscando caracteres o codigos q son conocidos y generan sql por inyeccion y otros

para esto funciones varias..

explode();
str_replace ();
Código PHP:
function trim(strtexto){    
            var 
i;
            var 
sw 1;
            var 
inlargo strtexto.length;
            var 
strretorno "";
            for(
i=0;i<inlargo;i++){
                if(
sw == 1){
                    if(
strtexto.charAt(i) != " "){
                        
sw 0;
                        
strretorno strretorno strtexto.charAt(i);
                    }        
                }else{
                    
strretorno strretorno strtexto.charAt(i);
                }
            }
            
sw 1;
            
strtexto strretorno;
            
inlargo strtexto.length;
            
strretorno "";
            for(
i=(inlargo 1);i>=0;i--){
                if(
sw == 1){
                    if(
strtexto.charAt(i) != " "){
                        
sw 0;
                        
strretorno strtexto.charAt(i) + strretorno;
                    }        
                }else{
                    
strretorno strtexto.charAt(i) + strretorno;
                }    
            }
            return 
strretorno;
        } 
etc... saludos
__________________
sEIK! -Chile-
Analista Programador.