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

[eluser]csablotron[/eluser]
Smile

finally i embed

[removed]
var RecaptchaOptions = {
theme:"<?= $theme ?>",
lang:"<?= $lang ?>"
};
[removed]
[removed][removed]
<noscript>
&lt;iframe src="&lt;?= $server ?&gt;/noscript?lang=&lt;?= $lang ?&gt;&k=&lt;?= $key.$errorpart ?&gt;" height="300" width="500" frameborder="0"&gt;&lt;/iframe><br/>
&lt;textarea name="recaptcha_challenge_field" rows="3" cols="40"&gt;&lt;/textarea>
&lt;input type="hidden" name="recaptcha_response_field" value="manual_challenge"/&gt;
</noscript>
&lt;?php // echo $recaptcha; ?&gt;
<br />

on my view... and recaptcha working hehehe...

great

Thanks JayTee for your library...
#72

[eluser]fran-quero[/eluser]
Hello. JayTee, thank you very much for your work. It´s great to come to CI for first time and find it filled with usefull libraries.

I´ve installed reCaptcha, but I can´t make it work. My problem is the last step. The captcha form loads well, it´s validated when is blank, but when it´s filled it never validates, even if the 2 words are correct I always have the Incorrect Security Image Response.

A very important detail that I am embarrased for, is that the demo works perfect Sick
But I have compare every line, I have read all the post from this thread, I have spent about 3 hours, and as the great Homer Simpson said: 'It´s my first day'.

Please, give me a light. Here´s my code:

Controller
Code:
function create_user()
{
  $this->data['title'] = "Create User";

  //validate form input
  $this->form_validation->set_rules('first_name', 'First Name', 'required|xss_clean');
  //.... more validations ...
  $this->form_validation->set_rules('recaptcha_response_field','lang:recaptcha_field_name','required|callback_check_captcha');

  if ($this->form_validation->run() == true)
  {
     //.......
  } else {
    $this->data['recaptcha'] = $this->recaptcha->get_html();
    $this->load->view('auth/create_user', $this->data);
  }
}

function check_captcha($val) {
      if ($this->recaptcha->check_answer($this->input->ip_address(),$this->input->post('recaptcha_challenge_field'),$val)) {
        return TRUE;
      } else {
        $this->form_validation->set_message('check_captcha',$this->lang->line('recaptcha_incorrect_response'));
        return FALSE;
      }
}

Thanks in advance for your help.
#73

[eluser]JayTee[/eluser]
I'll take a look this evening and let you know what I find.
#74

[eluser]inverse.chi[/eluser]
I am getting exactly the same problem. Dragged the files into a fresh CI 2.0 installation and am not able to validate even when the correct text is entered.

Any luck?

[quote author="fran-quero" date="1298090051"]Hello. JayTee, thank you very much for your work. It´s great to come to CI for first time and find it filled with usefull libraries.

I´ve installed reCaptcha, but I can´t make it work. My problem is the last step. The captcha form loads well, it´s validated when is blank, but when it´s filled it never validates, even if the 2 words are correct I always have the Incorrect Security Image Response.

A very important detail that I am embarrased for, is that the demo works perfect Sick
But I have compare every line, I have read all the post from this thread, I have spent about 3 hours, and as the great Homer Simpson said: 'It´s my first day'.

Please, give me a light. Here´s my code:

Controller
Code:
function create_user()
{
  $this->data['title'] = "Create User";

  //validate form input
  $this->form_validation->set_rules('first_name', 'First Name', 'required|xss_clean');
  //.... more validations ...
  $this->form_validation->set_rules('recaptcha_response_field','lang:recaptcha_field_name','required|callback_check_captcha');

  if ($this->form_validation->run() == true)
  {
     //.......
  } else {
    $this->data['recaptcha'] = $this->recaptcha->get_html();
    $this->load->view('auth/create_user', $this->data);
  }
}

function check_captcha($val) {
      if ($this->recaptcha->check_answer($this->input->ip_address(),$this->input->post('recaptcha_challenge_field'),$val)) {
        return TRUE;
      } else {
        $this->form_validation->set_message('check_captcha',$this->lang->line('recaptcha_incorrect_response'));
        return FALSE;
      }
}

Thanks in advance for your help.[/quote]
#75

[eluser]SteRiley[/eluser]
[quote author="ahmad karim" date="1296439136"]the class is not working any more for CI 2.0
please help?

error msg:


An Error Was Encountered

Unable to load the requested file: recaptcha.php[/quote]

I have attempted to implement the recaptcha code also into CI2.0 and I am also getting the same error as Ahmad. Anyone have a fix for this yet?

I am currently using the old implementation used here: http://ellislab.com/forums/viewthread/94299/ this is working fine for me at the moment, but would like to switch to this new version.
#76

[eluser]Lit_Tiger[/eluser]
Hi,
I have created reCAPTCHA library for CI, converted from original plugin.
It's work for mail hide too.
Should I post it here?
#77

[eluser]inverse.chi[/eluser]
You could do Smile

[quote author="Lit_Tiger" date="1299242377"]Hi,
I have created reCAPTCHA library for CI, converted from original plugin.
It's work for mail hide too.
Should I post it here?[/quote]
#78

[eluser]Lit_Tiger[/eluser]
Ok, here it's my one.

You can download under following link.

http://www.thetechspace.com/?download=re...ci-library

Firstly, you have to move Recaptcha.php file into CI file structure system/application/libraries/
Load that library -
Code:
$this->load->library('recaptcha');


Set the keys -
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
Sometime you just need to set only one public key. So, just set public key only.
To set the keys


To Show reCAPTCHA image and from. You just simply need to call recaptcha_get_html () function. In that function you can define theme and language of reCAPTCHA (Customization).
The function builded like -

Code:
recaptcha_get_html ( $error = null, $use_ssl = false, $options = array ('theme' => 'red', 'lang' => 'en') )


So,You just simply need to call like -

Code:
$options = array ('theme' => 'clean', 'lang' => 'fr') ;
echo $this->recaptcha->recaptcha_get_html ( '', false, $options )

To check the answer from client

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;
}

For mail hide

To use mail hide function, set mail hide api keys -

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

The Mailhide version of [email protected] is
Code:
echo $this->recaptcha->recaptcha_mailhide_html ("[email protected]");

The url for the email is:
Code:
echo $this->recaptcha->recaptcha_mailhide_url ("[email protected]");

That it's!

I hope it's help for somebody.
#79

[eluser]inverse.chi[/eluser]
Thank you Smile I will try this out tomorrow on a project Smile

[quote author="Lit_Tiger" date="1299257508"]Ok, here it's my one.

You can download under following link.

http://www.thetechspace.com/?download=re...ci-library

Firstly, you have to move Recaptcha.php file into CI file structure system/application/libraries/
Load that library -
Code:
$this->load->library('recaptcha');


Set the keys -
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
Sometime you just need to set only one public key. So, just set public key only.
To set the keys


To Show reCAPTCHA image and from. You just simply need to call recaptcha_get_html () function. In that function you can define theme and language of reCAPTCHA (Customization).
The function builded like -

Code:
recaptcha_get_html ( $error = null, $use_ssl = false, $options = array ('theme' => 'red', 'lang' => 'en') )


So,You just simply need to call like -

Code:
$options = array ('theme' => 'clean', 'lang' => 'fr') ;
echo $this->recaptcha->recaptcha_get_html ( '', false, $options )

To check the answer from client

Code:
$resp = $this->recaptcha->recaptcha_check_answer ( $this->input->ip_address(), $this->input->post('recaptcha_challenge_field',true), $this->input->post('recaptcha_challenge_field',true));

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

For mail hide

To use mail hide function, set mail hide api keys -

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

The Mailhide version of [email protected] is
Code:
echo $this->recaptcha->recaptcha_mailhide_html ("[email protected]");

The url for the email is:
Code:
echo $this->recaptcha->recaptcha_mailhide_url ("[email protected]");

That it's!

I hope it's help for somebody.[/quote]
#80

[eluser]Unknown[/eluser]
So what were the official responses to
http://ellislab.com/forums/viewthread/67250/P70/#859472
and
http://ellislab.com/forums/viewthread/67250/P70/#862835

Likewise, I installed everything but always get 'Incorrect Security Image Response' even when I know I entered the words correctly.

Please Help




Theme © iAndrew 2016 - Forum software by © MyBB