Re-captcha is a free web service to add a secured captcha on your website to avoid spams. Spams filled up your inboxes with unnecessary emails or messages which you have no need. Re-captcha is provided by Carnegie Mellon University which are serving over 60 millions captchas in a day.

Here are some simple steps to complete this whole process.

1- Just go to re-captcha sign up page and enter your information. You need to add your site url there. And each of your site which you need to be deployed with re-captcha must have its domain name on your account in re-captcha site.

2- You will get public and private kep after entering your domain name and clicking on Create Key button. Save these codes into a notepad.

3- Download re-captcha library (recaptchalib.php) which will be used to interact with re-captcha API.

4- We will use this library as helper in codeigniter. Because this library holds a list of function which interacts re-captcha API. Paste this helper in to your system/application/helpers folder.

5- Now the work has been done at configuration level. Call your helper in controller.

6- In your controller, paste this code. Here the recaptcha_check_answer is used to get what code a user entered.

In codeigniter we use config file to hold some global constant types values so i put private recaptcha key (private_recaptcha_key) in config file.

Similar Posts