First thing you need to do is download the latest ReCaptcha Library. You can download it from recaptcha.net Then, upload the file “recaptchalib.php” to your web server. The best place to store your library files is your resource folder. Then you need to go to reCAPTCHA.net website, click on the “My Account” link (You may need to login for that) and then click “Add a new site” and follow the instructions given.
After you went through this process, create an API key for the site you want to add reCAPTCHA to. When you are done, you’ll be given a Public & Private API key for your website. Keep these information safe, as you need them in next step.
In the view file, place the following code where you want it to appear in your form.
In the controller file put the following code segment to validate the captcha input and report if the input is not correct.
The last step is to implemet error reporting in the Form. How to implement this part varies depending on how you handle your error reporting. But basically you can add the following next to my reCAPTCHA field:
echo form_error('recaptcha_challenge_field');
And that's how to implement reCAPTCHA in your CodeIgniter web application. Cheers!
