[eluser]JayTee[/eluser]
I run it as part of the validation routine as a custom rule. Here's the function:
Code:
function check_captcha($val) {
$this->recaptcha->recaptcha_check_answer($_SERVER["REMOTE_ADDR"],$this->input->post('recaptcha_challenge_field'),$val);
if ($this->recaptcha->is_valid) {
return true;
} else {
$this->validation->set_message('check_captcha','Incorrect Security Image Response');
return false;
}
}
It's a part of the validation rule
Code:
$rules = array(
'recaptcha_response_field'=>'required|callback_check_captcha'
);
$this->validation->set_rules($rules);
Hope this helps. I know I need to tweak the code (and make it better) - I've just been swamped lately.