I am trying to get reCAPTCHA to work in my simple PHP script. I keep receiving the error incorrect-captcha-sol while processing the form and I am not sure what's going on. I've seen other people have issues when the form is within a table tag but that is not the case for me. Any ideas?
Here is the relevant portion of index.php (with key masked/randomized)
<div>
<form name="submit-complaint" action="process-complaint.php" method="post">
What now?
<textarea name="complaint"></textarea>
<input type="submit" value="Complain" />
<div>
<?php
require_once('include/recaptchalib.php');
$publickey = "6LeaTb8-PUBLICKEY-T1XAsPQICozztsVj_kyS2t";
echo recaptcha_get_html($publickey);
?>
</div>
</form>
</div>
Here is the relevant portion of process-complaint.php with key masked/randomized
<?php
require_once('include/recaptchalib.php');
$privatekey = "MYPRIVATEKEY-ACZmGS_KUEXQBnq9YpTVp1Wzawj3";
$resp = recaptcha_check_answer($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_respond_field"]);
if (!$resp->is_valid) { die($resp->error); }
//....
?>