[thelist] PHP include

Jack Timmons codeacula at codeacula.com
Fri Aug 6 15:08:28 CDT 2010


On Fri, Aug 6, 2010 at 2:41 PM, DAVOUD TOHIDY <dtohidy at hotmail.com> wrote:
> <?php
>
> $privatekey = "**********************************";
> $resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],
> $_POST["recaptcha_challenge_field"],
> $_POST["recaptcha_response_field"]);
>
> if (!$resp->is_valid) {
> // What happens when the CAPTCHA was entered incorrectly
>
> $reCaptcha .= "The reCAPTCHA wasn't entered correctly. Please try it again.";
>
> } ?>
>
> Now I have mycontact.php file:
>
> so the the content would be like this:
>
> <?php
> // here I need to include the verify.php content in here ( the logic is at: http://code.google.com/apis/recaptcha/docs/php.html )
> else { do some validation and handle a successful verification }
> ?>

So use:

if ($resp->is_valid) {
    doStuff();
}

-- 
Jack Timmons
@_Codeacula


More information about the thelist mailing list