"For security reasons, you must pass the remote ip to reCAPTCHA"
I keep getting the warning: "For security reasons, you must pass the remote ip to reCAPTCHA" no matter what I change within my code and I just can't understand why. The Google documentation for implementing in PHP is very simple and the resulting script throws no syntax errors.
It seems to have a problem with this line (Google's code) in verify.php:
<!-- Comments Section -->
<div class="cmnt_wrap"><div class="cmnt_bakg"><div class="cmnt"><?php include "blog_cmnt.html"; ?></div></div></div>
<!-- Reply to Post -->
<div class="rply_wrap"><div class="rply_bakg"><div class="rply_head"></div><div class="rply_body"><div class="rply_innr">
<form id="blog_rply" action="script/verify.php" onsubmit="return validateForm()" method="post">
<p><label for="name" />Name </p>
<fieldset><input type="text" id="name" name="name" class="field" /></fieldset>
<p><label for="content" /><br/>Enter your comment in the box below<br/></p>
<p><textarea id="content" name="comment" class="field" rows="" cols=""></textarea><br/></p>
$publickey = "my_public_key_hiddden";
<fieldset><input type="submit" id="submit" name="submit" value="" /></fieldset>
The other PHP script is the recaptchalib.php which was downloaded from: https://code.google.com/p/recaptcha/...Aphplib-Latest this has not been altered.
$privatekey = "my_private_key_hidden";
$resp = recaptcha_check_answer ($privatekey,
// If repsonse is NOT (!) valid, warn the user
die ("The reCAPTCHA wasn't entered correctly. Please try again.".
"(reCAPTCHA said: " . $resp->error . ")");
// If the response is correct then allow comments to be added
$name = $_POST['name'];
$content = $_POST['comment'];
$handle = fopen("../blog_cmnt.html","a");
fwrite($handle,"<b>" . $name . "</b>:<br/>" . $content . "<br/><br/>");
echo "Your comment has been added, now returning to Bells Domestics Blog...";
header('Location:' . $_SERVER['HTTP_REFERER']);
I would really appreciate some help and if anyone else is suffering from the same issues maybe they can get them resolved too.
UPDATE: reCAPTCHA removed!
After the effort to get reCAPTCHA to work we still got spam and from the context, frequency and no. of pages viewed they were bots.
To fix I made a small PHP script to send the contents of the message to my email address at work, after which I will manually add comments after reviewing them first. It seems the only way to fully block all spam.
Ps: Google has now reduced our website to 2 extra links under our main URL due to this latest spam, so I can't take the risk any more. I HATE spammers :mad:
By the way if anyone wants my code for the message system, pm me and I will help you implement it, maybe you will have better luck than I did!