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