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.
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).
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