Home > Web Mania > Easy captcha without javascript images and math

Easy captcha without javascript images and math

September 12th, 2007 Lascia un commento Vai ai commenti

An easy captcha without javascript, without images, without math. Only a few of CSS and a few of server side (coldfusion) programming: a walkover!
Let’s go!

 

We can begin with a simple standard FORM.

<form name="frm_xxx" action="reg.cfm" method="post">

Nome <input type="text" name="name"><br />

Sito <input type="text" name="site"><br />

Mail <input type="text" name="email"><br />

Commento<br>

<textarea name="comment"></textarea>

</form>

 

What a spam spider do?

It reads page, reads input fields, sends form act http.referrer and inserts some value (spam) into every fields. Perfect!

Let the spider plays its game!

We insert an hidden input with CSS. Human users don’t see it, spider sees it.

 

<!— SYSTEM WITH "NON TRADITIONAL" CAPTHA —>
<div style="visibility:hidden">
Please don’t insert text in the input below. If you do it you can’t comment. <br />
<input type="text" name="hiddenCaptcha" value="" style="width:1px;height:1px;font-size:1px;" />
</div>

 

To hidden it we use a few of CSS code, inline on HTML or we can use a simply class and apply it on DIV or on INPUT…
Pay attention: don’t use

display:none

With "display:none" input isn’t sent to destination page!!! (reg.cfm).

 

Another few seconds. We create a check (server-side) on destination page (reg.cmf): form is OK only when hiddenCaptcha exists and is empty ("").

 

 

<cfif not(isDefined("form.hiddenCaptcha") and form.hiddenCaptcha is "")>

Attention! Form wrong!

<cfabort>

</cfif>

Php version (by DvD):

if ( (array_key_exists("campoNascosto",$_POST)))
{
if ($_POST["campoNascosto"]<>"")
{
die ("Attenzione. Modulo non registrabile!");
}

Asp (old asp) version:

<%
function existsFormParam(name)
existsFormParam = (Request.Form(name).Count = 1)
end function

if (existsFormParam("captcha") and Request.Form("captcha") = "") then
Response.write("ok")
else
Response.write("no")
end if

%>

Et voilà, le jeux sont fait: I tested it from 2 months without a spam comment. Only some comment from really spam users :(
This kind of captcha works on system without javascript too!!!

Thanks to Thisistoboring for his comment on Digg :)

 

Versione italiana.

 

Approfondimenti online

La tecnologia informatica ha fatto passi da gigante. In modo particolare Google, che con il suo analizzatore di testo, è in grado di proporre collegamenti contestuali a quanto hai appena letto. Questi i link pubblicitari proposti da Adsense.

  1. April 26th, 2007 at 15:36 | #1

    it works even with black berry original browser!

    great thing merlinox

  2. April 26th, 2007 at 15:42 | #2

    Thanks baby!

  3. April 27th, 2007 at 11:13 | #3

    Good work MrX! I hope some other implement this idea in its software!
    In my blog on blogspot (some of) my friends don’t send me their comment because they don’t understand captcha
    [and they don't are various skillful (handicapped - I hope it's saying so...)!]

    P.S. In Digg I write 2 time to match captcha – Here nothing!!!

  4. April 27th, 2007 at 11:21 | #4

    @dvd: I’m very happy. I’m not the only one who wrongs inserting captcha… :) I hate them.

  1. February 28th, 2008 at 09:42 | #1

Additional comments powered by BackType