https://github.com/hok00age/codeigniter-recaptcha
An easy-to-use CodeIgniter library to work with reCAPTCHA version 2.0 a.k.a NO CAPTCHA reCAPTCHA.
https://github.com/hok00age/codeigniter-recaptcha
Last synced: 12 months ago
JSON representation
An easy-to-use CodeIgniter library to work with reCAPTCHA version 2.0 a.k.a NO CAPTCHA reCAPTCHA.
- Host: GitHub
- URL: https://github.com/hok00age/codeigniter-recaptcha
- Owner: hok00age
- Created: 2015-02-12T09:53:54.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-13T06:23:37.000Z (about 11 years ago)
- Last Synced: 2024-02-15T11:31:23.969Z (about 2 years ago)
- Language: PHP
- Size: 92.8 KB
- Stars: 48
- Watchers: 8
- Forks: 28
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-codeigniter - CodeIgniter Recaptcha - CodeIgniter library to work with reCAPTCHA. (Libraries)
README
# CodeIgniter Recaptcha
An easy-to-use CodeIgniter library to work with reCAPTCHA version 2.0 a.k.a NO CAPTCHA reCAPTCHA.

## Installation
Copy the files to their respective location.
##Configuration
Open "**application/config/recaptcha.php**" and put your SITE key, SECRET key, and desired language there.
```php
$config['recaptcha_sitekey'] = "";
$config['recaptcha_secretkey'] = "";
$config['lang'] = "";
```
Site key and secret key can be obtained from [https://www.google.com/recaptcha/admin/](https://www.google.com/recaptcha/admin/), while language code can be obtained from [https://developers.google.com/recaptcha/docs/language](https://developers.google.com/recaptcha/docs/language).
## Basic Usage Instruction
#### Call `render()` method from your VIEW file.
It will render reCAPTCHA widget onto your view
```php
recaptcha->render(); ?>
```
#### Validate in your CONTROLLER
```php
// Load the library
$this->load->library('recaptcha');
// Catch the user's answer
$captcha_answer = $this->input->post('g-recaptcha-response');
// Verify user's answer
$response = $this->recaptcha->verifyResponse($captcha_answer);
// Processing ...
if ($response['success']) {
// Your success code here
} else {
// Something goes wrong
var_dump($response);
}
```
## Live demo
[http://rajaongkir.com/kontak](http://rajaongkir.com/kontak)