Skip to main content
Inspiring
December 21, 2009
Answered

web form spam

  • December 21, 2009
  • 3 replies
  • 3732 views

Hi I am a novice CF dude. I have a web registration form that gets bogus registrations and I am trying get my users to type in a word to help limit spam. I am not sure how to do this and google and the forums do not show any cf examples.

I have tried various versions of the following

<cfset enter="alignment">
        <p><em>Please enter the word <cfoutput>#enter#</cfoutput> in to the field below to help us limit spam.</em></p>
        <br />

         <div class="register">
<label for="enter">Enter alignment:</label>
            <cfinput type="text" name="enter">
            <cfinput type="hidden" name="enter_required">
        </div>

If a user does not fill in the field, it will not submit. However, it will accept any text and I want it to except only alignment. any help most appreciated.

Jim

    This topic has been closed for replies.
    Correct answer joecopley

    If you are getting automated bot spam, and don't want to impose a captcha, try this simple approach: code a blank hidden field in your form, then check to see if the form is populated when submitted. If it is, then don't process. I do this on contact forms, and give the field the name 'apartment,' so it isn't so obviously a honeypot.

    It won't catch everything, but it seems to help.

    Joe

    3 replies

    joecopleyCorrect answer
    Inspiring
    December 21, 2009

    If you are getting automated bot spam, and don't want to impose a captcha, try this simple approach: code a blank hidden field in your form, then check to see if the form is populated when submitted. If it is, then don't process. I do this on contact forms, and give the field the name 'apartment,' so it isn't so obviously a honeypot.

    It won't catch everything, but it seems to help.

    Joe

    rockhikerAuthor
    Inspiring
    December 21, 2009

    Thanks for the ideas, I will try both. I like the hidden field idea. It seems to be the most accessible.

    jim

    Inspiring
    December 21, 2009

    Hi Jim,

    Try the "CFImage" tab, through which you can create these "CAPTCHA's"!!..

    Follow this nice tutorial,

    http://www.bennadel.com/blog/873-Using-CAPTCHA-In-ColdFusion-8.htm

    Refer this documentation also,

    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_i_02.html

    HTH

    Inspiring
    December 21, 2009

    Using captcha is a better approach.  Google "coldfusion captcha" to learn more.