Skip to content

A simple Google ReCaptcha implementation for CodeIgniter - Easy installation - Write Less Code

Notifications You must be signed in to change notification settings

RazaLabs/Codeigniter-Google-ReCaptcha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Codeigniter-Google-ReCaptcha

Codeigniter-Google-ReCaptcha uses Codeigniter Form Validation.You just need to edit your config and form view.You don't need to write any extra codes.A simple Google ReCaptcha implementation for CodeIgniter - Easy installation - Write Less Code With 2 Steps

Demo

###Demo Page alt tag

Usage

You can easily implement "Google ReCaptcha" to your forms with 2 Steps.You don't need to write any extra codes on the controller for Google ReCaptcha validation.Just use codeigniter validation library.

Code Sample

Controller

$this->load->library('form_validation');
$validation_rules = array(); // If you have another form rules you can define
$this->form_validation->set_rules($validation_rules);
if($this->form_validation->run()){
	exit("Form validated");
}

Installation Step-1

Open the "config/gcaptcha" file and write to "gcaptcha_server_secret" and "gcaptcha_client_secret" codes.

/*
|--------------------------------------------------------------------------
| Google Captcha Server Secret Code
|--------------------------------------------------------------------------
*/
$config['gcaptcha_server_secret'] = '';

/*
|--------------------------------------------------------------------------
| Google Captcha Client Secret Code
|--------------------------------------------------------------------------
*/
$config['gcaptcha_client_secret'] = '';

Installation Step-2

Put these codes into the your html forms.

<?php echo create_gcaptcha();?>
<span class="error"><?php echo gcaptcha_error();?></span>

About

A simple Google ReCaptcha implementation for CodeIgniter - Easy installation - Write Less Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%