Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] - ReCaptcha - błąd któego nie można usunąć.
Dominator
post
Post #1





Grupa: Zarejestrowani
Postów: 565
Pomógł: 15
Dołączył: 11.10.2010

Ostrzeżenie: (20%)
X----


Mam problem z ReCaptchą, gdy przepiszę wyraz dobrze czy źle mam takie coś: "Could not open socket". Od godziny się nad tym głowię i nie wiem co zrobić, pomóżcie.

Składa się to z 3-ech plików.

Plik example-captcha.php

  1. <html>
  2. <body> <!-- the body tag is required or the CAPTCHA may not show on some browsers -->
  3. <!-- your HTML content -->
  4.  
  5. <form method="post" action="stat.php">
  6. <?php
  7. require_once('recaptchalib.php');
  8. $publickey = "6LdSmcASAAAAAAeMnioo5DRz2Q1yc5DqNvHaEj_h"; // you got this from the signup page
  9. echo recaptcha_get_html($publickey);
  10. ?>
  11. <input type="submit" />
  12. </form>
  13.  
  14. <!-- more of your HTML content -->
  15. </body>
  16. </html>


stat.php (tj. verify.php)

  1. <?php
  2. require_once('recaptchalib.php');
  3. $privatekey = "6LdSmcASAAAAAENcQhVTMsqME4WUB-9npPsyFtXR";
  4. $resp = recaptcha_check_answer ($privatekey,
  5. $_SERVER["REMOTE_ADDR"],
  6. $_POST["recaptcha_challenge_field"],
  7. $_POST["recaptcha_response_field"]);
  8.  
  9. if (!$resp->is_valid) {
  10. // What happens when the CAPTCHA was entered incorrectly
  11. die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
  12. "(reCAPTCHA said: " . $resp->error . ")");
  13. } else {
  14. // Your code here to handle a successful verification
  15. }
  16. ?>


Oraz plik recaptchalib.php

http://wklej.to/mLasQ

^Za długi ... nie mieści się tutaj winksmiley.jpg


A tutaj link do strony: http://redeem-it.aq.pl/example-captcha.php

Ten post edytował Dominator 18.01.2011, 13:31:37
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 00:39