Gossamer Forum
Home : Products : Others : Gossamer Community :

captcha, I am not a robot

Quote Reply
captcha, I am not a robot
I am trying to use Google's "I am not a robot" captcha. Apparently they acquired recaptcha, and changed it.

I want to use it on my community user signup page. Adding the code to the user signup template is easy, and it works fine.

The verify part is causing the problem. Google's instructions are found here:

I tried to include the appropriate code as part of
sub user_signup

the XXXXXXXXXX represents the code assigned to me by Google for the captcha.

my $URL = 'https://www.google.com/recaptcha/api/siteverify?secret=XXXXXXXXXX&response=g-recaptcha-response';
my $contents = get $URL or die;
# Split contents variable by comma
my ($success, $challenge_time, $hostname) = split /,/, $contents;
# Split success variable by colon
my ($success_title, $success_value) = split /:/, $success;
#strip whitespace:
$success_value =~ s/^\s+//;
if ($success_value eq "true")
print "it worked";
print "it did not";

I get this error message
Can't locate object method "get" via package "https://www.google.com/recaptcha/api/siteverify?secret=XXXXXXXXXXXX&response=g-recaptcha-response" (perhaps you forgot to load "https://www.google.com/recaptcha/api/siteverify?secret=XXXXXXXX&response=g-recaptcha-response"?) at /var/home/cyberinstitute/cyberinstitute.org/cgi-bin/community/private/lib/Community/Web/User.pm line 439.
Thanks for your help!
Quote Reply
Re: [tora] captcha, I am not a robot In reply to

You probably are not including LWP::Simple?

use LWP::Simple

Personally though, I use this module to do it:



Andy (mod)
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!