First of all thanks for those that help me with this. I am roughly new
to Perl web development so this is a little over my head with this.
I am trying to implement ReCaptcha
http://search.cpan.org/~andya/Captcha-reCAPTCHA-0.92/lib/Captcha/reCAPTCHA.pm
into my registration form that is using Cgi::Application and
html::template.
My Error:
[Wed Jun 24 11:53:03 2009] [error] [client 192.168.1.5] Use of
uninitialized value in concatenation (.) or string at MinimalApp.pm line
22., referer: http://192.168.1.9/cgi-bin/index.pl
[Wed Jun 24 11:53:03 2009] [error] [client 192.168.1.5] Use of
uninitialized value in concatenation (.) or string at MinimalApp.pm line
24., referer: http://192.168.1.9/cgi-bin/index.pl
[Wed Jun 24 11:53:03 2009] [error] [client 192.168.1.5] Error executing
run mode 'registration': For security reasons, you must pass the remote
ip to reCAPTCHA at MinimalApp.pm line 120, referer: http://192.$
[Wed Jun 24 11:53:03 2009] [error] [client 192.168.1.5] at
/usr/lib/cgi-bin/index.pl line 4, referer:
http://192.168.1.9/cgi-bin/index.pl
[Wed Jun 24 11:53:03 2009] [error] [client 192.168.1.5] Premature end of
script headers: index.pl, referer: http://192.168.1.9/cgi-bin/index.pl
My Code in the CGI Part:
this is in my process_template sub
my $c = Captcha::reCAPTCHA->new;
$template->param(CAPTCHA => $c->get_html( 'mypublickeyitookout' ));
my $result = $c->check_answer(
'myprivatekeyitookout', $ENV{'192.168.1.9'},
my $challenge, my $response
);
if ( $result->{is_valid} ) {
print "Yes!";
}
else {
# Error
my $error = $result->{error};
}
Then on my HTML part im just calling <TMPL_VAR NAMe="CAPTCHA">
Do i need to do the $query->param("challenge") or whatever the form is?
Thanks again for helping me.
-Scott
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/