Jan 16
Evita el SQL injection en ASP
Esta función ya os la presenté anteriormente pero ayer me decidí a mejorarla basándome en este pdf
function limpia(text,encode)
dim banned,i
limpia=text
banned = array("""","'","&","--","select","insert","update","delete","drop")
for i = 0 to uBound(banned)
limpia = replace(limpia, banned(i),"")
next
if encode=true then
limpia=server.htmlencode(limpia)
end if
end function




July 24th, 2008 at 5:10 pm
<%
function validar_entrada( input )
palabras = array( “script”, “select”, “insert”, “update”, “delete”,”drop”,”DECLARE”,”declare”,”EXEC”,”exec” ,”VARCHAR”,”varchar” , “–”, “‘” )
validar_entrada = True
for i = lbound( palabras ) to ubound( palabras )
if ( instr( 1, input, palabras(i), vbtextcompare ) 0 ) Then
validar_entrada = false
exit function
end if
Next
end function
%>
July 24th, 2008 at 5:43 pm
hola german, no esta mal el codigo….pero…
y si el usuario pone — como algo normal? ya no insertas nada en la BBDD?