kyleldi Posted March 2, 2009 Share Posted March 2, 2009 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 More sharing options...
phpdragon Posted March 2, 2009 Share Posted March 2, 2009 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 More sharing options...
kyleldi Posted March 2, 2009 Author Share Posted March 2, 2009 It errors out that headers have already been sent. "Warning: Cannot modify header information - headers already sent." This is what I've been running into. Link to comment https://forums.phpfreaks.com/topic/147565-captcha-help/#findComment-774659 Share on other sites More sharing options...
phpdragon Posted March 2, 2009 Share Posted March 2, 2009 put it right at the top of your page, you cant post any html before u do the redirect Link to comment https://forums.phpfreaks.com/topic/147565-captcha-help/#findComment-774661 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.