Salve a tutti.
sto realizzando un form per invio email. Ho trovato su internet diverse soluzioni al mio problema, tutte molto simili, le ho implementate anche separatamente, purtroppo restituiscono sempre messaggio di errore. dopo il submit (ho evidenziato in rosso il messaggio di errore). Qualcuno potrebbe illuminarmi? Grazie per la pazienza!


<?php
require_once('inc/recaptchalib.php');
$publickey = "xxxx"; // you got this from the signup page
$privatekey = "xxxx";


$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);


if ($resp->is_valid) {
echo "success";

}
else
{
echo "false";
}
?>



altro file:

<?php
require_once('inc/recaptchalib.php');
$publickey = "xxx"; // you got this from the signup page
$privatekey = "xxx";
?>


function validateCaptcha()
{
challengeField = $("input#recaptcha_challenge_field").val();
responseField = $("input#recaptcha_response_field").val();
//alert(challengeField);
//alert(responseField);
//return false;
var html = $.ajax({
type: "POST",
url: "ajax.recaptcha.php",
data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
async: false
}).responseText;

if(html == "success")
{
$("#captchaStatus").html("Success. Submitting form.");
return false;
// Uncomment the following line in your application
//return true;
}
else
{
$("#captchaStatus").html("Your captcha is incorrect. Please try again");
Recaptcha.reload();
return false;
}
}
</script>