Help keep getting errors

5 views
Skip to first unread message

outofbox

unread,
Apr 17, 2009, 6:42:00 PM4/17/09
to reCAPTCHA
I am not a PHP programmer... but literate and need some help.
I followed the inko9nito blog I found on the direction page, but I
keep
getting errors.

I put this piece of code before the Submit button, where I want the
CAPTCHA
to appear. (the recaptchaliblib is in the same directory as the php
form  and made sure to put the proper keys between the quotes...)

<?php
require_once('recaptchalib.php');
$publickey = "…";
?>

"We need to add the following code to the process.php file" .... I
added it to
the same book_new.php before the form begins

<?php
require_once('recaptchalib.php');
$privatekey = "...";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["....."],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
die ("The reCAPTCHA wasn’t entered correctly. Go back and try it
again." .
"(reCAPTCHA said: " . $resp->error . ")");
}
?>

    <?
$FromEmail = 'Unions in Paradise <eve...@unionsinparadise.com>';
$ToEmail = 'Unions in Paradise <eve...@unionsinparadise.com>';
$Subject = 'Web Contact Form';
$Success = 'Thank you for your interest in Unions in Paradise. Your
inquiry
has been successfully sent. A representative will contact you
promptly. We
look forward to creating another "Event Remembered".';

The error I get is for the following form
(http://www.unionsinparadise.com/book_new.php) is:

(For security reasons, you must pass the remote ip to reCAPTCHA) 

I put the unionsinparadise.com  IP address in the code and I've also
tried it leaving the default: $_SERVER["REMOTE_ADDR"],


What am I doing wrong? Before I added the captcha code you could see
the
form and it worked fine, just having problems with the spammers
hijacking
the form...
Any assistance would be greatly appreciated.

Paul Herring

unread,
Apr 19, 2009, 12:59:55 AM4/19/09
to reca...@googlegroups.com
On Fri, Apr 17, 2009 at 11:42 PM, outofbox
<kst...@outsidetheboxdzine.com> wrote:
> $resp = recaptcha_check_answer ($privatekey,
> $_SERVER["....."],

This is wrong. It needs to be

$_SERVER["REMOTE_ADDR"],

> $_POST["recaptcha_challenge_field"],
> $_POST["recaptcha_response_field"]);

--
PJH

http://shabbleland.myminicity.com/ind
http://www.chavgangs.com/register.php?referer=9375

Reply all
Reply to author
Forward
0 new messages