reCAPTCHA is a free CAPTCHA service that protect websites from spam and abuse.
#Usage First, register keys for your site at here
Then,To use the recaptcha plugin its required to include the following two lines in your /app/Config/bootstrap.php
file.
Configure::write('Recaptcha.publicKey', 'public-api-key');
Configure::write('Recaptcha.privateKey', 'private-api-key');
Controllers that will be using recaptcha require the Recaptcha Component to be included. Through inclusion of the component, the helper is automatically made available to your views.
public $components = array('Recaptcha.Recaptcha');
In the view simply call the helpers display() method to render the recaptcha input:
echo $this->Recaptcha->display();
To check the result simply do something like this in your controller:
if ($this->request->is('post')) {
if ($this->Recaptcha->verify()) {
// verified
} else {
// display the error
}
}