views:

347

answers:

2

I wrote a AS3 script, basically the script just a form that allow user to enter their email address. After launch the site for couple of months, I found I receive a lots of BOT spammers. I know, 1 way of prevent BOT is using recaptcha thing, beside recaptcha, is there any way to prevent bot to submit my AS3 form??

+1  A: 

How about adding an extra input to your form and then hiding it with a CSS style.

Then if the field is filled in, you can be pretty sure it was a bot.

  • Bots don't generally process CSS rules so they will see the text input and fill it in
  • Most people have CSS enabled when they browse so they won;t see the text input and it will be blank

For legitimate users that have CSS disabled, you can add a label (also hidden via css) to the text input that tells them what to enter.

e.g. add something like this into your form

<div style="display:none">
<label for="hidden-textbox">What is 10 plus 5?</label>
<input type="text" id="hidden-textbox" name="hdn-txt" maxlength="20"/> 
</div>

When you process the form submission:

  • nothing in the text input is a legitimate user
  • the value that you told them to enter in the caption is a legitimate user
  • any value other than empty or your specified value is SPAM and you can discard it
Nils
my form is in flash, can I add those css things?
Sorry - it looks like I didn't properly answer your question. I doubt that my suggestion would work if the entire form is in flash because flash is taking care of the presentation rather than the css if the form were in plain html. If it's feasible for your site, perhaps you could look at converting your form to plain html?
Nils
A: 

In addition to Nils' excellent answer, see this previous Stack Overflow question for a wide survey of some of the anti-bot measures that are currently popular.

Also, I'm not sure you'll want to use AS3, as that is both server side, and may be more complicated than you need. Still, if you used a Flash app to submit your form (rather than having form information embedded into your HTML), then it would be harder for a bot to parse and submit.

HanClinto