Welcome Guest, Not a member yet? Register   Sign In
ReCAPTCHA library - ignited
#91

[eluser]w0bbes[/eluser]
[quote author="Lit_Tiger" date="1303425984"]please try my one
http://ellislab.com/forums/viewreply/864505/[/quote]

Thanks for your reply!

Where do i use this part:
Code:
$resp = $this->recaptcha->recaptcha_check_answer (
$this->input->ip_address(),
$this->input->post('recaptcha_challenge_field',true), $this->input->post('recaptcha_response_field',true)
);

if ($resp->is_valid) {
                echo "You got it!";
} else {
                # set the error code so that we can display it
                $error = $resp->error;
}


Atm, im using it after $this->form_validation->run() but it says:
Code:
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: controllers/tip.php
Line Number: 48
#92

[eluser]Lit_Tiger[/eluser]
did u download the library ?

i m not sure u use the Jaytee's one or my one?
#93

[eluser]w0bbes[/eluser]
[quote author="Lit_Tiger" date="1303429275"]did u download the library ?

i m not sure u use the Jaytee's one or my one?[/quote]

Using yours
#94

[eluser]Lit_Tiger[/eluser]
you download library file from
http://www.thetechspace.com/2011/03/04/r...deigniter/
then saved into lib folder then
$this->load->library('recaptcha');
loaded right?

if so , should be work . could u show me .. some more code above that?
#95

[eluser]w0bbes[/eluser]
[quote author="Lit_Tiger" date="1303430806"]you download library file from
http://www.thetechspace.com/2011/03/04/r...deigniter/
then saved into lib folder then
$this->load->library('recaptcha');
loaded right?

if so , should be work . could u show me .. some more code above that?[/quote]

this is part of the code above
Code:
$this->form_validation->set_rules('naam','naam','required|xss_clean');
            $this->form_validation->set_rules('naam_vriend','naam vriend(in)','required|xss_clean');
            $this->form_validation->set_rules('email','e-mail vriend(in)','required|xss_clean|valid_email');
            
if($this->form_validation->run()){
                    
                    $resp = $this->recaptcha->recaptcha_check_answer (
            $this->input->ip_address(),
            $this->input->post('recaptcha_challenge_field',true), $this->input->post('recaptcha_response_field',true)
            );
            
            if ($resp->is_valid) {
                            echo "You got it!";
#96

[eluser]Lit_Tiger[/eluser]
Did u set the keys?

Like

Code:
// Get a key from https://www.google.com/recaptcha/admin/create
$this->recaptcha->set_key ('XXXXXXXXXX Key XXXXXXXXX' ,'public') // For public key
$this->recaptcha->set_key ('XXXXXXXXXX Key XXXXXXXXX' ,'private') // For private key
#97

[eluser]w0bbes[/eluser]
Yep i did.

when i submit i get:
Code:
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: controllers/tip.php
Line Number: 48
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: controllers/tip.php
Line Number: 106
#98

[eluser]Bangon Kali[/eluser]
[quote author="w0bbes" date="1303431497"]Yep i did.

when i submit i get:
Code:
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: controllers/tip.php
Line Number: 48
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: controllers/tip.php
Line Number: 106
[/quote]

Can you post your code on that file along that line number? Perhaps a link from pastebin.com in order to be more clear with code highlighting.
#99

[eluser]w0bbes[/eluser]
Line 48 is the last line on the code below:
Code:
if($this->form_validation->run()){
                    
                    $resp = $this->recaptcha->recaptcha_check_answer (
                        $this->input->ip_address(),
                        $this->input->post('recaptcha_challenge_field',true), $this->input->post('recaptcha_response_field',true)
                    );
            
                    if ($resp->is_valid) {

Line 106 is this line:
Code:
$error = $resp->error;

[eluser]Bangon Kali[/eluser]
Code:
function _check_recaptcha() {
        $this->load->helper('recaptcha');

        $resp = recaptcha_check_answer($this->config->item('recaptcha_private_key', 'tank_auth'),
            $this->input->ip_address(),
            $this->input->post('recaptcha_challenge_field'),
            $this->input->post('recaptcha_response_field'));

        if (!$resp->is_valid) {
            $this->form_validation->set_message('_check_recaptcha', $this->lang->line('auth_incorrect_captcha'));
            return FALSE;
        }
        return TRUE;
    }

Please check if you have your private key properly covered in your code.




Theme © iAndrew 2016 - Forum software by © MyBB