0
Ich versuche, meine $_POST['g-recaptcha-response']
auf https://www.google.com/recaptcha/api/siteverify, um zu überprüfen, aber ich erhalte das folgende Ergebnis:Invisible recaptcha SiteVerify - Fehlercodes
"success": false,
"error-codes": [
"missing-input-response",
"missing-input-secret"
]
Mein Code:
if($has_errors == false) {
$result = file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, stream_context_create(array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query(array(
'response' => $_POST['g-recaptcha-response'],
'secret' => variable_get('google_recaptcha_secret', '')
)),
),
)));
var_dump($result);
$result = json_decode($result);
if($result->success == false) {
form_set_error('name', t('Submission blocked by Google Invisible Captcha.'));
}
}
ich meine Variable geprüft google_recaptcha_secret
, das ist richtig.
ich den file_get_contents Code in einem Online-Beispiel gefunden, aber mit curl anstatt das Problem behoben - danke! – Paul