Hello,
I just implemented the reCaptcha PHP Code on my homepage and ran into some problems.
The contact form loads the reCaptcha box successfully, so far everything ist good.
The specified php file is loaded via "post"-action. And returns the user-defined error-message.
I tried several times, I'm absolute sure, that I entered the correct captures.
I already checked private/public keys, no misunderstandings.
For my eyes everything seems to be correct, but it just won't work.
Any ideas? Or known issues? Thanks a lot!
Here are the code-passages in question:
File: contact.php: <form method="post" action="mail.php">
[...]
<?php
require_once('recaptchalib.php');
$publickey = "here-is-my-publickey-no-error-on-that-one";
echo recaptcha_get_html($publickey);
?>
<input type="submit" value="send" name="B1" style="float: right">
</form>
>
File: mail.php: <?php
require_once('recaptchalib.php');
$privatekey = "here-is-my-privatekey-already-checked-that";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
die ("<br> Please try again!<br>" .
"(reCAPTCHA says: " . $resp->error . ")<br><br>- <a href='javascript:history.back()'>zurück</a> -");
} else {
[...]
include ("mailsend.php);
}
?>