How To: Use Re-Captcha in Codeigniter based website?

Author: Zeeshan Rasool  |  Last updated on Codeigniter, PHP, Web Development

[ad#co-4]
re-captcha in codeigniterRe-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.
[ad#co-1]

Recommended WordPress Themes Store



If you enjoyed this post, please consider leaving a comment below or subscribing to the RSS feed to have future articles delivered to your feed reader. You can also follow us on Facebook or Twitter @99Points

This awesome post has been created by 99Points editor's team. You can follow our updates on Twitter and facebook, OR drop an email at 99points.info@gmail.com


Email Subscriber!

Be the first to know about new updates


Advertisement

Friends

Categories


Popular post