recaptcha not working

1,741 views
Skip to first unread message

robirdman

unread,
Mar 29, 2013, 1:01:50 PM3/29/13
to reca...@googlegroups.com
I followed the directions for adding the client side code to a simple form test page,
But I see no captcha image.  I have asked recaptcha support for help but got none.
Can someone tell me what is wrong with this?

Clon Takos

unread,
Apr 1, 2013, 10:24:07 AM4/1/13
to reca...@googlegroups.com
The instructions you followed were directed towards adding recaptcha to a PHP file? Because if I look at the source code of your file I can see the <?php code. Since it's a file with the HTML extension, you might need to change it to recaptcha-test.php 

robirdman

unread,
Apr 1, 2013, 2:58:11 PM4/1/13
to reca...@googlegroups.com

robirdman

unread,
Apr 1, 2013, 2:59:06 PM4/1/13
to reca...@googlegroups.com
How would I convert an HTML file to a PHP?  Just change the extension?
 

On Friday, March 29, 2013 12:01:50 PM UTC-5, robirdman wrote:

Jeff Conklin

unread,
Apr 1, 2013, 3:03:59 PM4/1/13
to reca...@googlegroups.com
That depends on your server setup. Most Apache webservers can parse PHP automatically when you use a .php extension. You can test this by creating a .php file, adding in PHP code, and caling the script (either through your browser or on the command line). You may also want to ask your host to verify that a .php file is PHP parsable.
--
You received this message because you are subscribed to the Google Groups "reCAPTCHA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to recaptcha+...@googlegroups.com.
To post to this group, send email to reca...@googlegroups.com.
Visit this group at http://groups.google.com/group/recaptcha?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

robirdman

unread,
Apr 2, 2013, 10:42:07 AM4/2/13
to reca...@googlegroups.com
the full page that I have been trying to put the recaptcha on is http://theearlybirder.com/guestbook.html
A friend helped set it up using PHP which apparently works because I get tons of unwanted SPAM from it and automatically delete everything.
 
The problem is that the letters to enter don't change and so automatons flood it.
I am trying to replace what is there with the recaptcha.  I first tried on a test page, just adding the code, and when that didn't work, kept reducing the content till only the form part is left.  This is what link I put before.  It still doesn't show.
 
In the orginal setup there is a php page and a js page.
 
I can modify either of those if I knew what to do.  How would anything work if the recaptcha is not on the page with the form?

On Friday, March 29, 2013 12:01:50 PM UTC-5, robirdman wrote:

Clon Takos

unread,
Apr 2, 2013, 11:09:19 AM4/2/13
to reca...@googlegroups.com
Your code is correct, it's just that your HTML page is not being parsed by the PHP engine. For that you need to change it's name to .php instead of .html. Then, you need to add some verification in the page that receives the form data (as it is right now, your code is being sent by a file called "verify.php" in the same directory. Do you have such a file?) and then inside you have to check the captcha for correctness:
 
require_once('recaptchalib.php');
$privatekey = "your_private_key";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
// Your code here to handle a successful verification
}

El viernes, 29 de marzo de 2013 18:01:50 UTC+1, robirdman escribió:

robirdman

unread,
Apr 4, 2013, 5:56:19 AM4/4/13
to reca...@googlegroups.com
I changed the name and created a verify.php file in the same directory with the code listed, and my other code below, but I still get below the form:
 
Warning: require_once(recaptchalib.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/11/7055011/html/recaptcha test.php on line 31

Fatal error: require_once() [function.require]: Failed opening required 'recaptchalib.php' (include_path='.:/usr/local/php5_3/lib/php') in /home/content/11/7055011/html/recaptcha test.php on line 31
and no Recaptcha.
 
 

On Friday, March 29, 2013 12:01:50 PM UTC-5, robirdman wrote:

robirdman

unread,
Apr 4, 2013, 6:18:17 AM4/4/13
to reca...@googlegroups.com
The code of the verify.pho is below, but I replaced the private key with the words,here, in case it wasn't a good idea to include that here. In my directory and on the web, the real key is present.
 

<?php


require_once(
'recaptchalib.php');
$privatekey =
"privatekey";


$resp = recaptcha_check_answer ($privatekey,
$_SERVER[
"REMOTE_ADDR"],
$_POST[
"recaptcha_challenge_field"],
$_POST[
"recaptcha_response_field"]);

if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
}
else {
// Your code here to handle a successful verification
}


$txt = stripslashes($txt);
$txt = trim($txt);
$mailto =
"robi...@aol.com";
$body =
"Name: $name\n\nE-mail address: $email\n\nComments: $txt";
mail($mailto, $subject, $body);
?>

<html>
<head>

<title>Guestbook Response</title>

</head>

<body>


On Friday, March 29, 2013 12:01:50 PM UTC-5, robirdman wrote:

robirdman

unread,
Apr 9, 2013, 10:42:05 AM4/9/13
to reca...@googlegroups.com
This is ridiculous.  I've reached a dead end. I spent 5 hours trying to figure out what is wrong and can't.  No one on the forum knows either.  Recaptcha "contact" is phony, doesn't go anywhere but back in a circle.  another example of the computer age where you just go around in circles because there is no real help offered and when you run into an impasse you may be stuck there for weeks or forever.

Keith Norris

unread,
Apr 9, 2013, 5:42:46 PM4/9/13
to reca...@googlegroups.com
The error msg you posted on Apr 4 (stream....) means you have not successfully copied the recaptcha library file to your web server where it can be found. The require_once () is failing in that case, which means nothing will work.

Remember you are a non-programmer attempting to implement a fairly sophisticated programming solution for FREE, and you must depend on volunteer help. Expect some setbacks, remain "gracious and tenacious" if you want to succeed.

Good luck!

robi...@theearlybirder.com

unread,
Apr 11, 2013, 2:24:30 PM4/11/13
to reca...@googlegroups.com
I wondered about this. I don't think I have such a file.  In the instructions to install the recaptcha, it doesn't mention how to get the recaptcha library file.  Maybe I got it years ago.  That is when I first attmpted this and was sent the keys.  I never got anywhere.  Now trying again, all I see is the instructions for pasting the code for PHP.

On Friday, March 29, 2013 12:01:50 PM UTC-5, robirdman wrote:

robi...@theearlybirder.com

unread,
Apr 11, 2013, 4:31:04 PM4/11/13
to reca...@googlegroups.com
So I found the recaptchalib.php file and put it in the same form tester folder but it still doesn't show.

On Friday, March 29, 2013 12:01:50 PM UTC-5, robirdman wrote:

robi...@theearlybirder.com

unread,
Apr 11, 2013, 4:39:20 PM4/11/13
to reca...@googlegroups.com
Maybe if someone could just tell me what to do with the recaptchalib.php ( or all that code in its HTML), I could make some progress.

On Friday, March 29, 2013 12:01:50 PM UTC-5, robirdman wrote:
Message has been deleted

Aaron Bangerter

unread,
May 1, 2013, 12:02:48 PM5/1/13
to reca...@googlegroups.com
Are you working on an apache server?  I can see from your source code that it's not handling the PHP in your html document.  If you are running on an apache server, then I would find the .htaccess file (or create one in a text editor) and add a line or two of code to parse PHP in the document.  I'd add:

AddHandler x-httpd-php5-cgi .html

See if that works...

robi...@theearlybirder.com

unread,
May 7, 2013, 7:06:53 PM5/7/13
to reca...@googlegroups.com
Server is GoDaddy.  Is that apache?

On Friday, March 29, 2013 12:01:50 PM UTC-5, robirdman wrote:

Rodin SD

unread,
Nov 8, 2015, 7:27:14 PM11/8/15
to reCAPTCHA


Why recaptcha isn't working? Why it shows to me?

screenshot-2captcha com 2015-11-09 00-36-12.png

Thomas Whitten

unread,
Dec 29, 2016, 7:11:08 AM12/29/16
to reCAPTCHA
I have found that setting your computers to the google.com dns servers solved my problems.  I'm not going into how to do that here but first, google the IP address of the google.com dns servers.  Then go into your control panel, choose the network connection you're using, click properties, IPv4, then override the default DNS servers box to use the google dns servers.

Google likes to seriously track everyone using it so when I get done with the recaptcha, I set all my dns resolution servers back to default.
Reply all
Reply to author
Forward
0 new messages