reCAPTCHA helper and validation function (easy-to-use captcha) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: reCAPTCHA helper and validation function (easy-to-use captcha) (/showthread.php?tid=12444) |
reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 10-19-2008 [eluser]vendiddy[/eluser] This is a widely used captcha implementation. It's used at big sites like Facebook and CraigsList. Steps to Use 1. Sign up for an access key at http://recaptcha.net/ 2. Get recaptchalib.php from the zip archive located at http://code.google.com/p/recaptcha/downloads/list?q=label:phplib-Latest. 3. Rename recaptchalib.php to recaptcha_helper.php and put it in your helpers folder. 4. Add the following function to recaptcha_helper.php: Code: function recaptcha() 4. Add the following function to your MY_Validation class as seen below in the libraries folder. (If you don't already have one a MY_Validation class, make one.) Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 5. Create a recaptcha.php in your config folder and add your public and private keys (the ones you got from registering) as seen below: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Example usage in a controller: Code: public function register() In the view, you can create the captcha form element by echoing <?= recaptcha() ?> I can package all of this into a zip file upon request. reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 10-19-2008 [eluser]bijon[/eluser] Thanks a lot. Very cool. You can send me the zip in this email [email protected]. Also i want to publish this things in my blog with refer you. Keep up this good work. reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 10-29-2008 [eluser]Berserk[/eluser] hi, i got this problem Code: This reCAPTCHA key isn't authorized for the given domain. More info Do you know why and how to fix? I think it's because reCAPTCHA system :-? Note: i used public and private key both for subdomain and domain. reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 10-30-2008 [eluser]vendiddy[/eluser] [quote author="Berserk" date="1225278450"]hi, i got this problem Code: This reCAPTCHA key isn't authorized for the given domain. More info Do you know why and how to fix? I think it's because reCAPTCHA system :-? Note: i used public and private key both for subdomain and domain.[/quote] Have you been able to fix the problem? I'm not sure what the issue is. Try to make sure your domain name matches and that you entered in your public / private keys in correctly into the config file. reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 11-07-2008 [eluser]Berserk[/eluser] thanks, i tried with other domain and it works ! But look like their problem with subdomain. reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 12-17-2008 [eluser]PermanaJ[/eluser] this is what i'm looking for. Would you like to send me the zip file ? I'm a little bit confuse with the validation, form_validation, and the view .. so i need to look the whole file ... ohh, almost forgot .. you can send to [email protected] reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 12-18-2008 [eluser]vendiddy[/eluser] Hi PermanaJ, I wrote this helper for version 1.6 of CI. The current version of CI is now 1.7 which uses form_validation instead of validation. Someone else modified it to work with version 1.7 and posted it here: http://ellislab.com/forums/viewthread/96365/ Good luck! reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 12-18-2008 [eluser]PermanaJ[/eluser] Ohh .. im using 1.7 .. thank a lot for the information ... but the code above work well with 1.7 reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 01-24-2009 [eluser]Unknown[/eluser] Hi, I am not a website admin, I am just trying to post a comment into a site that uses Capcha. The Capcha works for everyone else, i.e. they can see an image and a field to enter what they see and are able to click sumbit, but not for me. Instead, I get the same message "This reCAPTCHA key isn't authorized for the given domain. More info" I read the replies but don't understand the cause of the problem, as I'm not very capcha savvy.. can anyone help? thank you reCAPTCHA helper and validation function (easy-to-use captcha) - El Forum - 07-02-2009 [eluser]Tobz[/eluser] I've made changes to make this work in CI 1.7.x First, rename MY_Validation.php to MY_Form_validation.php then change the code to match this: Code: <?php and thats it. Your recapture should now work with the current form validation class. |