CodeIgniter Forums
reCAPTCHA 2 - 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 2 (/showthread.php?tid=13034)

Pages: 1 2


reCAPTCHA 2 - El Forum - 11-08-2008

[eluser]Blazeme[/eluser]
Hello everyone!
This code is originally is written by: vendiddy (Topic) but, it's using old validation class.
This one is packed and it uses new version of validation class.

Important! You must have account on reCAPTCHA.NET to get public and private keys. Without keys, this addon won't work!!

Pack is here, it contains ReadMe and code.

Hope you'll like this one.
Please report bugs and etc here.
Thanks.

Edit:
You can also download this addon from Wiki .


reCAPTCHA 2 - El Forum - 11-08-2008

[eluser]dexcell[/eluser]
Thanks


reCAPTCHA 2 - El Forum - 11-08-2008

[eluser]Blazeme[/eluser]
Np, when you guys test it out, please let me know Smile


reCAPTCHA 2 - El Forum - 11-16-2008

[eluser]OES[/eluser]
I did have a small issue with this.

Due to extanding the Form Validation I had to do add this-> before CI. ie.

Code:
function recaptcha_matches()
    {
        $this->CI =& get_instance();
        $this->CI->config->load('recaptcha');
        $public_key = $this->CI->config->item('recaptcha_public_key');
        $private_key = $this->CI->config->item('recaptcha_private_key');
        $response_field = $this->CI->input->post('recaptcha_response_field');
        $challenge_field = $this->CI->input->post('recaptcha_challenge_field');
        $response = recaptcha_check_answer($private_key,
                                           $_SERVER['REMOTE_ADDR'],
                                           $challenge_field,
                                           $response_field);
        if ($response->is_valid)
        {
            return TRUE;
        }
        else
        {
            $this->CI->form_validation->recaptcha_error = $response->error;
            $this->CI->form_validation->set_message('recaptcha_matches', 'The %s is incorrect. Please try again.');
            return FALSE;
        }
    }

Hope this helps.


reCAPTCHA 2 - El Forum - 12-05-2008

[eluser]BrandonDurham[/eluser]
Anyone know how to get two recaptchas on one page? It currently will only display the second recaptcha.


reCAPTCHA 2 - El Forum - 12-06-2008

[eluser]BrandonDurham[/eluser]
For those wondering, I had to use the ajax method: http://recaptcha.net/fastcgi/demo/ajax


reCAPTCHA 2 - El Forum - 01-14-2009

[eluser]BrandonDurham[/eluser]
Okay, now I've been informed that it's throwing an error. When you submit the form the "To use reCAPTCHA you must get an API key from..." error pops up. Any ideas?


reCAPTCHA 2 - El Forum - 01-20-2009

[eluser]The Wizard[/eluser]
Hello!

anyone had success while, loading the VALIDATION settings from form_validation.php ?
if i put the vali settings there, it dosnt seem to work Sad


reCAPTCHA 2 - El Forum - 05-17-2010

[eluser]ahmad karim[/eluser]
I have added this function in my Form_validation.php. is it important to add the helper MY_Validation_helper.php. i am not able to check if the captcha enterd is correct or not. there is no validation applying on captcha field. i.e. recaptcha_challenge_field. help please.

[quote author="OES" date="1226855802"]I did have a small issue with this.

Due to extanding the Form Validation I had to do add this-> before CI. ie.

Code:
function recaptcha_matches()
    {
        $this->CI =& get_instance();
        $this->CI->config->load('recaptcha');
        $public_key = $this->CI->config->item('recaptcha_public_key');
        $private_key = $this->CI->config->item('recaptcha_private_key');
        $response_field = $this->CI->input->post('recaptcha_response_field');
        $challenge_field = $this->CI->input->post('recaptcha_challenge_field');
        $response = recaptcha_check_answer($private_key,
                                           $_SERVER['REMOTE_ADDR'],
                                           $challenge_field,
                                           $response_field);
        if ($response->is_valid)
        {
            return TRUE;
        }
        else
        {
            $this->CI->form_validation->recaptcha_error = $response->error;
            $this->CI->form_validation->set_message('recaptcha_matches', 'The %s is incorrect. Please try again.');
            return FALSE;
        }
    }

Hope this helps.[/quote]


reCAPTCHA 2 - El Forum - 05-16-2011

[eluser]Jujubins[/eluser]
An Error Was Encountered
Your application/config/recaptcha.php file does not appear to contain a valid configuration array.

What I can do?