#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    How to check if form field value is x?


    Hi,

    I'm quite new to Coldfusion-development, but a script I'm running is using it. It turns out spambots are registering thousands of useraccounts on my site, just deleted more than 100.000 of them, and for that reason I will need to add some kind of "human-verification" on this site.

    I do know php, but I can't really find any functions in Coldfusion to check if a form field value contains for instance "coffecup." I know that in php we can do this with something like "if($_POST[xx]=='coffecup') {go on}", I would very mutch appreciate if anyone of you could tell me how to do this in Coldfusion? I'm thinking about just adding a simple field to the form asking users to type in a word before they create the account. Just need to know how to check if the word actually is the word.

    Thanks in advance for any help.

    Regards
    @atle
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,263
    Rep Power
    968
    You can use form.fieldName = 'x' or form['fieldName'] = 'x' to access the form fields when they are posted to CF.

    However, if you'd like a more robust option I would look at a free option such as http://cfformprotect.riaforge.org/.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0
    Thanks.

    I don't think its necessary with any more robust solution in my case, but I'll definitely check it out if the simple solution doesnt work.

IMN logo majestic logo threadwatch logo seochat tools logo