-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
33 lines (29 loc) · 1006 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<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.
}
}
}
}
?>