Form security question

Hi,

I have a form that I would like to add some code to keep the bots out. Something simple like “how much is 2+10” or some other requirement.

Can anyone tell me how to do this, or is there a cut and paste code I could get somewhere on the internet?

Thanks,
sarb

It’s simple really, in the form label you have whatever math problem you want them to answer (like What’s 1+2) and then when you parse the form you simply have an if statement to say “if it’s value is 3, then go ahead”. No script required, it’s just a case of checking the right result was put in the box. :slight_smile:

sorry, but I don’t have any programming knowledge. What do you mean by “parse the form” and how do you create an “if” statement??

Thanks,
sarb

Alternately, you can generate a random string and then ask them to type it. I use PHP to do this. It will not block a determined attack, but it works for a small site like mine.

sarb, parsing the form is basically when people hit submit, the data is “sent” somewhere to be dealt with, usually this is to a script which formats the information and tells it what should happen (whether that be email, save to a database, save to a cookie or whatever). If you want to accomplish such a script you’ll unfortunately need to use scripting, and I don’t know of any pre-built scripts as it’s a very simple thing to achieve, thereby a lack of a need for a pre-made solution. :slight_smile: