Send Voicemail | EnAcCiOn
Contact me using vCita | EnAcCiOn
Contact Form & Online Scheduling by vCita
Contact me using vCita | EnAcCiOn
Meeting Scheduler Powered by vCita
jueves, 30 de julio de 2015
Response value in noCaptcha reCaptcha always false
My goal is to use google's "noCaptcha reCaptcha" mechanism to verify, if the user is a human on a contact form for a website. I am not a very experienced web developer, so I had to look up several tutorials on PHP and POST-methods. I now got it working to the point, where I do get a response from google, but the value for the "success" element returned by the POST request is always false, even though the graphical element on the webpage says it is fine. The error code returned by the same request is "NULL", which I guess is a good thing. Am I misunderstanding something here? All research on this specific error only turned up cases, where either the response value was not assigned or there has been an error message of some kind. I use google's API (link to the used API) for reCaptcha here, because attempts at sending HTTP-Request objects and using curl flat out did not work. In the first case I guess it is because of missing libraries and in the second case "response" always got a "NULL" value assigned (or rather no value, because this was the default). In the following code parts, $secret is the secret key from google, $response is the code sent by the captcha, gotten from $_POST["g-recaptcha-response"]. The mail code itself works perfectly fine, I tested it seperately before. This is the var_dump output: object(ReCaptchaResponse)#2 (2) { ["success"]=> bool(false) ["errorCodes"]=> NULL } This is the client code: $reCaptcha = new ReCaptcha($secret); if ($response) { $answer = $reCaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $response); } else { echo "There has been an error with the authentication"; } var_dump($answer); if ($answer != NULL && $answer->success) { $err = mail($recipient, $subject, $mailtext, implode("\r\n", $headers)); if ($err == false) { echo "The mail could not be sent."; } echo "The E-Mail was sent."; } else { echo "Your identity could not be verified."; }
Suscribirse a:
Enviar comentarios (Atom)
EnAcCiOn
Contador Web | EnAcCiOn
EnAcCiOn
-
shows de baile de la colombiana laura en el kilombo (huacho) | EnAcCiOn.Tk ░░░░░░░░░░░░▄▄░░░░░░░░█░█░█░░█░█▀▀░▀█▀░█▀▀ ░░░░░░░░░░░█░░█░░░░...
-
C-C-C CIUCCIA CAZZI DI CAVALLO PAOLO BARRAI DI WMO E BSI ITALIA SRL, UNA VOLTA CACCIATO (E FATTO CONDANNARE A GALERA) DA CITIBANK, PRIMA DI ...
-
Hello, My code works fine a few days ago, but no, I have this problem. Code Example: $(function(){ widgetnu = grecaptcha.render('c...
-
Hi,I have resized it by transform:scale and all seems good until I get the pop-up bubble with pictures (napr.: "choose all cakes" ...
-
Any thoughts on this would be really helpful. Same issue posted in StackOverflow doesn't seem to get a response: I am trying to get Goog...
-
░░░░░░░░░░░░▄▄░░░░░░░░█░█░█░░█░█▀▀░▀█▀░█▀▀ ░░░░░░░░░░░█░░█░░░░░░░█░█░██░█░█▀░░░█░░█▀░ ░░░░░░░░░░░█░░█░░░░░░░▀▄▀░█░▀█░█▄▄░░█░░█▄▄ ░░░░░░░...
-
EL PAÃS compartió una publicación. VÃdeo | Aunque en las pelÃculas no da resultado, se ve que los mensajes en la arena funcionan en la ...
-
Diario El Comercio compartió una publicación. #YouTube Descubren a pedófilo en experimento de niña perdida [#VIDEO] ►http://bit.ly/1h8Up Pe...
EnAcCiOn
EnAcCiOn
Blog Archive | EnAcCiOn
-
►
2013
(1429)
- ► septiembre (156)
-
►
2014
(1220)
- ► septiembre (43)
-
▼
2015
(1589)
-
▼
julio
(326)
-
▼
jul 30
(10)
- Response value in noCaptcha reCaptcha always false
- ¡EnAcCiOn está listo! Edición del 30 julio 2015
- Re: ReCaptcha Admin list not expanding over 50 sites
- Re: word translation
- Immediate Hire for Mainframe Testing Position @Mor...
- Spammy link on v1 documentation page
- QA Analyst with Financial Services @ Merrimack, NH
- Re: ReCAPTCHA 2 + JQuery + IE 9/10/11 - Need to do...
- Re: ReCAPTCHA 2 + JQuery + IE 9/10/11 - Need to do...
- Panamericana Televisión: "Trendy: cómo bajar esos ...
-
▼
jul 30
(10)
-
▼
julio
(326)
No hay comentarios:
Publicar un comentario