Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

bhanwarpsrathore/reCaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reCaptcha Plugin for cakephp 2

Description

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
    }
}

Releases

No releases published

Packages

 
 
 

Languages