Skip to content

Instantly share code, notes, and snippets.

@fkumro
Created June 12, 2009 14:56
Show Gist options
  • Save fkumro/128677 to your computer and use it in GitHub Desktop.
Save fkumro/128677 to your computer and use it in GitHub Desktop.
<?php
function recaptcha_check($response)
{
// check to see if the recaptcha is correct
$resp = recaptcha_check_answer (
$this->_recaptcha_private_key,
$this->input->ip_address(),
$this->input->post('recaptcha_challenge_field'),
$this->input->post('recaptcha_response_field'));
if(!$resp->is_valid)
{
//reCaptcha is wrong
$this->form_validation->set_message('recaptcha_check', 'reCaptcha was wrong.');
return FALSE;
}
return TRUE;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment