Search code examples
securityspam-prevention

Whats the simplest way to secure your forms from spammers?


Whats the easiest way of stopping spammers from probing your forms (preferably without deterring real users)


Solution

  • A very simple method is known as the honeypot

    1. You create a hidden field that users can't fill out.
    2. If you recieve a form that has that field filled out, discard it.

    You can hide it by setting display none, or absolutely positioning the div behind something else, or completely off screen.

    The best part is that it does not affect your regular users at all.