Zen Follower
- Join Date:
- Feb 2008
- Posts:
- 141
- Plugin Contributions:
- 0
Support Thread for Google reCAPTCHA plugin
Any questions or problems let me know below
Regards
David
Zen Follower
Totally Zenned
Zen Follower
New Zenner
Zen Follower
<?php echo recaptcha_get_html($publickey, $resp->error); ?><?php echo recaptcha_get_html($publickey, $resp->error, true); ?>New Zenner
New Zenner
Zen Follower
mhawkins:
Any suggestions for adding captchas to ask a questions mod. I have put the code in the header.php of pages/ask a question. And also added it to templates/ask a question.default. I changed the code to reflect ask a question 1 time in header.php and 4 instantances in template default. But it does not work. I can see a thin box below the message box but captcha does not show and cannot not send an email through to myself. I am not sure where to go from here. I am installing on 1.5. The contact us captcha works fine.
// 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;
}
then change the line below from
if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
to
if ($zc_validate_email and !empty($enquiry) and !empty($name) and $error == false) {<?php echo recaptcha_get_html($publickey, $resp->error); ?> line at about line 80 in tpl_ask_a_question_defaultNew Zenner
Zen Follower
if ($zc_validate_email and !empty($enquiry) and !empty($name)) { if ($zc_validate_email and !empty($enquiry) and !empty($name) and $error == false) { New Zenner
Zen Follower
New Zenner
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
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) {Zen Follower
New Zenner
New Zenner
New Zenner
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
Zen Follower
ralberts:
Ok, that was one of my more moronic questions. :blush:
The captcha works fine on the Create Account page though.
if (!$resp->is_valid) { if ($resp->is_valid !== true) { New Zenner
Zen Follower
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
Destination thread ID and reason are required when shown.
Tell staff why this post should be reviewed.
Required for login, security, and core site functionality.
Help us understand how the site is used so we can improve it.
Used for promotion and personalized campaign measurement.