BotDetect PHP CAPTCHA Options:
Form Object Settings Code Example

PHP CAPTCHA validation
Custom Mexican Spanish Captcha reload icon tooltipCustom Mexican Spanish Captcha sound icon tooltip
 
PHP CAPTCHA validation
Custom Canadian French Captcha image tooltip
Custom Canadian French Captcha reload icon tooltip

CAPTCHA Code Example Description

This BotDetect Captcha PHP code example shows how to configure Captcha challenges by setting Captcha object properties in PHP form source.

Multiple PHP forms within the same PHP website can be protected by BotDetect Captcha challenges: e.g. you could include botdetect.php in both your Contact form and Registration form source.

To function properly, separate Captcha challenges placed on each form should have different names (CaptchaId values sent to the Captcha object constructor, Captcha1 and Captcha2 in this example), and can use completely different Captcha settings.

Even multiple Captcha instances placed on the same form won't interfere with each other's validation and functionality. And if a user opens the same page in multiple browser tabs, each tab will independently validate the shown Captcha code.

Shared Captcha settings should always be placed in the CaptchaConfig.php application configuration file, and only diverging settings set through Captcha object instance properties in form code, to avoid code duplication.

Settings that affect only Captcha container markup generation take effect immediately (changing $Captcha->Html output), but settings that affect Captcha challenge (image or sound) generation in separate Http requests need to be saved in PHP Session state when set through Captcha object instance properties in form source, consuming server resources and reverting to defaults when the PHP Session expires.

Please note that if configured values are dynamic (e.g. CaptchaRandomization helper or other function calls in form code), they will be re-calculated only when the form is reloaded (form code is executed). For example, Captcha ImageStyle randomized in PHP form source will not change on each Captcha Reload button click, but only on each form load.

Free Version Limitations

  • The free version of BotDetect only includes a limited subset of the available CAPTCHA image styles and CAPTCHA sound styles.
  • 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.

BotDetect PHP Captcha Library version 4.1.0 Free loaded by PHP version 7.2.34-38+ubuntu18.04.1+deb.sury.org+1