Send Voicemail | EnAcCiOn
Contact me using vCita | EnAcCiOn
Contact Form & Online Scheduling by vCita
Contact me using vCita | EnAcCiOn
Meeting Scheduler Powered by vCita
viernes, 17 de julio de 2015
Re: Recaptcha V2 hopefully made simple. Both HTML and PHP code included here
The STRPOS code actually works just fine. I don't check for "success" I check for 'false' but you can check for 'true' as well depending on how you want to proceed in your code. I'm absolutely certain doing the json_decode would work but this is just so much more simple. That's the wonderful thing about coding ... there are many ways to solve the same problem. I just think it's incredibly unfortunate that Google has not provided very clear coding examples that the non-coder can understand or at least follow. So many of us have obviously wasted hours searching for help that could be avoided by Google doing their job better.I usually work alone but I really enjoy opportunities to bounce ideas off others and get a different perspective. Thank you!On Thursday, July 16, 2015 at 5:07:57 PM UTC-7, kh99 wrote: Martin, What you wrote sounds right to me. I also saw your comment at codeforgeek.com. I also tried to leave a comment, but for some reason it wasn't posted (maybe they thought I was a spammer :) . But I had said basically the same thing you said, so we'll see if the guy responds. By the way, I didn't see Donna's last post before responding. I think the strpos method also works. as long as the 'success' doesn't appear in an error message (and I can't see why it would). But it's easy enough to use json_decode() to get an array, and then you have access to the error messages, so I think that's a better method. I don't know if there is any way to make it an actual object, but it's not necessary. Also, I unfortunately made a typo in my previous post, and I misspelled g-recaptcha-response in the hidden input tag I suggested to use as a test, which would make the script fail. So if anyone actually wants to try that, make sure to add the missing 's' to 'g-recaptcha-reponse'. On Thursday, July 16, 2015 at 2:14:05 PM UTC-4, Martin Brilliant wrote: Thanks, kh99, for pointing out an issue I was staring at for weeks without seeing it. I was looking at that dot and thinking it was an object property pointer. It is in some languages, but not in PHP. The result of $response.'success' is a non-empty string, which will always evaluate to true.A correct PHP object property pointer won't work anyway. According to Google's documentation, $response is a JSON object. A JSON object in PHP is just a string, and in order to do anything sensible with it (other than parsing it as a string) you have to convert it to something else. A commenter on the codeforgeek.com page recommended converting it to an associative array, and that's what I did. I found another site that show how to convert it to a PHP object. But treating the JSON string as an object in PHP, without converting it, won't play.I must confess I don't know PHP. I'm trying to get along by using and adapting other people's code and rummaging around for explanations. I think what I just wrote makes sense.On Wednesday, July 15, 2015 at 1:16:00 AM UTC-4, kh99 wrote: Martin is right, I think. This line is a problem: if($response.'success'==true) { echo '
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)
No hay comentarios:
Publicar un comentario