Noticias Weblogs Foros Wiki Código

RecorteX

317 usuarios y 202 recortes de código
Usuario

Contraseña
Crear cuenta
asp csharp css fechas fichero Flash html imagenes java javascript linux mysql oracle php ruby sql SQLServer vbnet xhtml xml
Top Usuarios
albin (29)
josuebasurto (28)
fjmp76 (27)
juanjo (25)
pedrocaro (9)
AndiXTRM (7)
Joserra (7)
miiglesi (6)
aplyca (5)
moisesmarquez (5)
Top Etiquetas
php (38)
html (23)
javascript (20)
vbnet (20)
java (19)
sql (15)
mysql (13)
csharp (12)
xml (10)
css (8)
imagenes (7)
Flash (7)
xhtml (6)
asp (6)
linux (6)
fechas (6)
SQLServer (5)
oracle (5)
fichero (4)
ruby (4)

anti-Spam para forms en ASP

Se trata de saber si previamente a la petición POST ha habido una petición GET de manera que denote un comportamiento humano, y además introducir algunos valores en cookies, para que no puedan hacer peticiones a saco con un robot cutre (tendrían que currarse un robot que gestione cookies).
 
 
	bSubmited  = (Request.ServerVariables("REQUEST_METHOD")="POST")
	bFromHere1 = (InStr(Request.ServerVariables("HTTP_REFERER"), "contacto.asp")>0)
	bFromHere2 = (Request.ServerVariables("REMOTE_ADDR")=Session("cv"))
	bFromHere3 = (Request.ServerVariables("REMOTE_ADDR")=Request.Cookies("cv"))
 
	if not bSubmit then
		Response.Cookies("cv") = Request.ServerVariables("REMOTE_ADDR")
		Session("cv")          = Request.ServerVariables("REMOTE_ADDR")
	end if
 
	if bSubmited and bFromHere1 and bFromHere2 and bFromHere3 then
		' todo
        end if
 
...
Identifícate para dejar un comentario.
info@recortex.com - Proyecto: Juanjo Navarro, 2006 - Diseño: Albin