Spam Catch without Captcha

By Nannette Thacker

Here is an example of how to set a spam trap without using Captcha. In your web form, typically a Register or Log In page, simply place a hidden textarea field. Then on your form action page, check the value and if it contains any content, you can redirect them to another page or do anything you like. Since a real human won't see or have access to this form field, only the bots will fill in the field.

ASP.net VB Example

<asp:TextBox ID="ReasonCatch" runat="server" 
        Rows="3" Style="display: none;" 
        TextMode="MultiLine"></asp:TextBox>
<asp:Button ID="GoButton" runat="server" Text="Go" 
TabIndex="5" OnClick="GoButton_Click" />

Retrieve

Protected Sub GoButton_Click(ByVal sender As Object, _
            ByVal e As System.EventArgs)
        
        Dim spamtrap As String = ""
        spamtrap = Me.ReasonCatch.Text
        If Not String.IsNullOrEmpty(spamtrap) Then
            Response.Redirect("~/byefool.aspx", False)
        Else
            ' further processing
        End If
        
    End Sub

ASP Classic Example

<textarea id="ReasonCatch" name="ReasonCatch" 
rows="3" cols="4" style="display: none;"></textarea>

Retrieve

    spamtrap = Request.Form("reasoncatch")
	if cstr(spamtrap) <> "" then
		Response.Redirect("/byefool.asp")
	end if 
    

In my actual code, I retrieve the IP address, and send an email to myself with the phrase they sent, along with the IP address, date and time, etc.

This helps to keep these spammers from mucking up your database with garbage records. So far I have caught and stopped a russian website spammer, a geocities spammer, and some really nasty porn links.

I found the original suggestion at the bottom of this page on A CAPTCHA Solution Built With Classic ASP, CSS And Javascript and it works great! I can't tell who the author is from looking at the site, but thanks!

May your dreams be in ASP.net!

Nannette Thacker

6 Comments

Comments have been disabled for this content.