Jump to content

Captcha Help


kyleldi

Recommended Posts

I'm using recaptcha to validate my form- but I can't manage to manipulate the code properly.  I need it to submit my file 'submit.php' instead of echoing 'you got it'.  Is there an easy way to do this?

 

if ($_POST["recaptcha_response_field"]) {
        $resp = recaptcha_check_answer ($privatekey,
                                        $_SERVER["REMOTE_ADDR"],
                                        $_POST["recaptcha_challenge_field"],
                                        $_POST["recaptcha_response_field"]);

        if ($resp->is_valid) {
                echo "You got it!";
        } else {
                # set the error code so that we can display it
                $error = $resp->error;
        }
}
echo recaptcha_get_html($publickey, $error);

 

Thanks!

 

Link to comment
https://forums.phpfreaks.com/topic/147565-captcha-help/
Share on other sites

try this

 

if ($resp->is_valid) {

                (process your data info here)

                header('Location: submit.php');

        }

 

 

the process information could be a databse query, insert or update or what ever you need to do then redirects to the page in the location feild when done

Link to comment
https://forums.phpfreaks.com/topic/147565-captcha-help/#findComment-774656
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.