Created
June 12, 2009 14:55
-
-
Save fkumro/128675 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function someAction() | |
{ | |
$this->load->library('form_validation'); | |
// set validation rule for the recaptcha response | |
$this->form_validation->set_rules('recaptcha_response_field', 'reCaptcha', 'required|callback_recaptcha_check'); | |
if ($this->form_validation->run() === FALSE) | |
{ | |
// store the recaptcha html code for the view | |
$data['recaptcha'] = recaptcha_get_html($this->_recaptcha_public_key); | |
// pass the data to the view | |
$this->load->view('someView', $data); | |
} | |
else | |
{ | |
// party | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment