reCAPTCHA

76 views
Skip to first unread message

Nick landry

unread,
Nov 12, 2012, 10:14:40 PM11/12/12
to reca...@googlegroups.com
Hello World !

Im pretty sure this has been talked about and/or covered before but I have yet to find someone with the similar problems.

Im trying to test a reCAPTCHA on a website im in the middle of building.

Ive followed all the steps on https://developers.google.com/recaptcha/intro as well as on recapctaha.com.

Now, the site it is for is NOT live. Im testing on my localhost.
I got the API keys for my "soon to be" site....I had no luck. I also got new keys for my localhost (hoping this would solve my issue...But no).

Basically, all my code looks and seems perfect, comparing it to the tutorial on https://developers.google.com/recaptcha/intro.

My code:
  <?php
  require_once('recaptchalib.php');
  $privatekey = "XXXXXXXXXX";
  $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

  if (!$resp->is_valid) {
echo "Failed!!";
  } else {
echo "Entered correctly!";
  }
  ?>




<html>
    <body> <!-- the body tag is required or the CAPTCHA may not show on some browsers -->
      <!-- your HTML content -->

      <form method="post" action="montreal.php">
      Name: <input type="text">
        <?php
          require_once('recaptchalib.php');
          $publickey = "XXXXXXXXX"; // you got this from the signup page
          echo recaptcha_get_html($publickey);
        ?>
        <input type="submit" name="submit1" value="I accept. Create my account" />
      </form>

      <!-- more of your HTML content -->
    </body>
  </html>

I cannot seem to get any Captcha images at all. All i get is the following notices:
Notice: Undefined index: recaptcha_challenge_field in C:\wamp\www\montreal.php on line 6
Notice: Undefined index: recaptcha_response_field in C:\wamp\www\montreal.php on line 7

An internal error occurred: 4CE57CB0CFFD0.A1411CB.5AA6

I thought this would be a breeze to do....I hope i am doing a simple mistake...
Can anybody give me a hand on this ? It would be greatly appreciated.

Thank you,
Nick

Image CAPTCHA

unread,
Nov 21, 2012, 5:02:55 PM11/21/12
to reca...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages