PHP Login Form CAPTCHA Sample

CAPTCHA included in PHP Login form validation
CAPTCHA
Reload the CAPTCHA codeSpeak the CAPTCHA code
 

Description

This sample project shows how to add BotDetect CAPTCHA validation to simple PHP login forms.

To prevent bots from trying to guess the login info by brute force submission of a large number of common values, the visitor first has to prove they are human (by solving the CAPTCHA), and only then is their username and password submission checked against the authentication data store.

Also, if they enter an invalid username + password combination three times, they have to solve the CAPTCHA again. This prevents attempts in which the attacker would first solve the CAPTCHA themselves, and then let a bot brute-force the authentication info.

To keep the example code simple, the sample doesn't access a data store to authenticate the user, but accepts all logins with usernames and passwords at least 5 characters long as valid.

Beta Release Warning

BotDetect PHP Captcha Library Beta is a work in progress, and we need you to guide our efforts towards a polished product. Please let us know if you encounter any bugs, implementation issues, or a usage scenario you would like to discuss.

Free Version Limitations

  • The free version of BotDetect includes a randomized BotDetect™ trademark in the background of 50% of all Captcha images generated.
  • It also has limited sound functionality, replacing the CAPTCHA sound with "SOUND DEMO" for randomly selected 50% of all CAPTCHA codes.
  • Lastly, the bottom 10 px of the CAPTCHA image are reserved for a link to the BotDetect website.

These limitations are removed if you upgrade your BotDetect license.