Re: Support Thread for Google reCAPTCHA
Hi David
I'm using ZenCart 1.5 and have successfully installed your mod on the Contact Us page.
The captcha block appears below the contact us form correctly.
The problem is however: with or without the code being filled in, the message is being sent successfully
I've checked my installation a few times and everything seems fine. It is obvious that I am still missing something somewhere.
I am using the "aberdeen-natural" theme.
Could you please assist.
Thanks
JC
Re: Support Thread for Google reCAPTCHA
Hi JC - Sounds like a similar problem to Ronel's above. I can only think that either the $error flag isn't being set when the capatcha returns as not valid, or that $error isn't being checked properly before the mail is sent.
If you could paste the top few lines of code from the file - I'll see what I can see.
Regards
David
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
David Allen
Hi JC - Sounds like a similar problem to Ronel's above. I can only think that either the $error flag isn't being set when the capatcha returns as not valid, or that $error isn't being checked properly before the mail is sent.
If you could paste the top few lines of code from the file - I'll see what I can see.
Regards
David
Hi Dave
Here are the first few lines up to and including your changes. (/includes/modules/pages/contact_us/header_php.php
Code:
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$error = false;
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
$name = zen_db_prepare_input($_POST['contactname']);
$email_address = zen_db_prepare_input($_POST['email']);
$enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));
$zc_validate_email = zen_validate_email($email_address);
// add in reCaptcha check
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// set the error code so that we can display it
$messageStack->add('contact', $resp->error);
$error = true;
}
if ($zc_validate_email and !empty($enquiry) and !empty($name) and $error == false) {
I did not change the original version, I replaced it with the one you supplied.
Thanks
JC
Re: Support Thread for Google reCAPTCHA
JC - can't see anything wrong with that - as you say it's the downloaded one. Very odd.
I've quickly tried a few other things that I thought could possibly cause it (and some that I was sure wouldn't), but have come up blank. I can't get it to send without the reCAPATCHA filled in.
I'm stumped, sorry. All I can suggest is putting some debugging statements in the file to try and find out why $error isn't being set to true when the reCAPATCHA isn't filled in.
Re: Support Thread for Google reCAPTCHA
Thanks for your prompt reply David. I will play around with it and post results here.
JC
Re: Support Thread for Google reCAPTCHA
Hi David,
No I didn't change the code manually - just installed your plug-in as it was. I did however check the code against your manual changes, and everything's as it should be.
The plugin installed a file called header_php.php, not header.php - maybe this is a problem?
Ronel
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
ralberts
Hi David,
No I didn't change the code manually - just installed your plug-in as it was. I did however check the code against your manual changes, and everything's as it should be.
The plugin installed a file called header_php.php, not header.php - maybe this is a problem?
Ronel
Ok, that was one of my more moronic questions. :blush:
The captcha works fine on the Create Account page though.
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
ralberts
Ok, that was one of my more moronic questions. :blush:
The captcha works fine on the Create Account page though.
:smile:
If it works fine on the Create Account page that removes several (unlikely) causes of the problem on the contact-us page. You could try putting some debugging statements in header_php.php (sorry about typo earlier that caused your confussion) eg print_r($resp) and see what is happening. Or you could try changing the line
Code:
if (!$resp->is_valid) {
to
Code:
if ($resp->is_valid !== true) {
in case there is some weird type conversion going on.
Re: Support Thread for Google reCAPTCHA
Hi David
I have just installed the mod. Thanks. But I have to say that I am having the same issues are some of the other users. The page goes through no matter if the code is correct or not. Has there been a fix or do you have some advise about this?
This si my site: www.assceneon.com
Also it does not seem to be rendered correctly. The picture is skew.
Donovan
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
dochsa
Hi David
I have just installed the mod. Thanks. But I have to say that I am having the same issues are some of the other users. The page goes through no matter if the code is correct or not. Has there been a fix or do you have some advise about this?
This si my site:
www.assceneon.com
Also it does not seem to be rendered correctly. The picture is skew.
Donovan
Hi Donovan
I've just tried it on your site and it appeared to work correctly :smile:. Can you check that you got just one email (EDIT two emails as I tried it using Firefox and IE) from me.
Regards
David