Skip to content

abdialeh/CodeIgniter-reCaptcha-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

<h1>Google ReCaptcha Api</h1>

http://code.google.com/intl/tr-TR/apis/recaptcha/docs/php.html The only difference 
all functions changes to object but $resp object changed to array.

old usage : $resp->is_valid | new usage : $resp['is_valid']
only include and use.

@example  <?php
 class ControllerName extends CI_Controller{
	function index(){
		$this->load->library('recaptcha');
		$data['captcha'] = $this->recaptcha->recaptcha_get_html();
		//print $captcha variable in your view file in anywhere.
		//verifing
		if($_POST){
			//if test your form, you may add $debug value. ( but before add $extra_param variable )
			$resp = $this->recaptcha->recaptcha_check_answer($this->input->server('REMOTE_ADDR'),
            $this->input->post('recaptcha_challenge_field'),
            $this->input->post('recaptcha_response_field'),
			array(),
			true
			);
			if($resp['is_valid']){
				echo 'Error:'.$resp['error'];
			}else{
				//your code here to handle a successfull verification.
			}
		}
	}
 }
 
 ?>

About

Google recaptcha api modified for codeigniter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published