PHP code example of mosaxiv / cakephp-invisible-recaptcha

1. Go to this page and download the library: Download mosaxiv/cakephp-invisible-recaptcha 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/ */

    

mosaxiv / cakephp-invisible-recaptcha example snippets


Configure::write('recaptcha', [
    'sitekey' => '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
    'secretkey' => '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe',
]);

$this->loadComponent('InvisibleReCaptcha.InvisibleReCaptcha',
    [
        // options
    ]);


echo $this->Form->create();
echo $this->Form->control('email');
echo $this->Form->submit();
echo $this->InvisibleReCaptcha->render();
echo $this->Form->end();

if ($this->InvisibleReCaptcha->verify()) {
    //do something
}