PHP code example of domingosjunior87 / honeypot-captcha

1. Go to this page and download the library: Download domingosjunior87/honeypot-captcha library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

domingosjunior87 / honeypot-captcha example snippets


CakePlugin::load('HoneypotCaptcha');

public $components = array(
    'HoneypotCaptcha.Honeypot' => array(
        'text' => array('email_user', 'email_admin'),
        'checkbox' => array('validate_submit', 'validate_form'),
        'hidden' => array('phone_number'),
        'errorMessage' => "Error message"
    )
);

public $helpers = array('HoneypotCaptcha.Honeypot');

echo $this->Honeypot->render();

if (!$this->Honeypot->validate()) {
	return $this->redirect(array('action' => 'index'));
}