Derek Jones edited this page Jul 5, 2012 · 18 revisions
Clone this wiki locally

Category:Libraries Category:Libraries::reCAPTCHA


This a CI 2.0.x implementation of the ReCAPTCHA API ( Forum Discussion:[Here](


* Uses config file for saving your reCaptcha keys and theme * Uses an editable view for the reCaptcha form that can be inserted anywhere in your code * Logs errors and messages to your log files rather than to the user's screen * Multilingual support. Check for supported languages and codes. English is the only language included (other language contributions welcome) * Uploaded needed files as a zip rather than copy/paste from the wiki * Download includes a sample that only requires you to include your API Keys from


Files Included

(These all go under your system/application folder) * **config/form_validation** - enables you to add/edit any rules you may need to include if the reCaptcha is part of a larger form * **config/recaptcha** - configuration of the reCaptcha parameters * **controllers/recaptchademo** - a quick demonstration page you can use for testing * **views/recaptcha_demo** - a view to help in testing * **views/recaptcha** - the form snippet used to generate the reCaptcha to the user * **libraries/recaptcha** - The reCaptcha library * **language/english/recaptcha_lang** - language entries



```php $config['recaptcha'] = array( 'public'=>'YOUR PUBLIC KEY', 'private'=>'YOUR PRIVATE KEY', 'RECAPTCHA_API_SERVER' =>'', 'RECAPTCHA_API_SECURE_SERVER'=>'', 'RECAPTCHA_VERIFY_SERVER' =>'', 'RECAPTCHA_SIGNUP_URL' => '', 'theme' => 'white' ); ```


```php function index() { $this->load->library('recaptcha'); $this->load->library('form_validation'); $this->lang->load('recaptcha'); $this->load->helper('form');
if ($this->form_validation->run()) 
  $this->load->view('recaptcha_demo',array('recaptcha'=>'Yay! You got it right!'));
  //the desired language code string can be passed to the get_html() method
  //"en" is the default if you don't pass the parameter
  //valid codes can be found here:


Feel free to check out the other files in the library and visit the discussion to ask questions.
That's it!