Good day,
I have this piece of code which validates a captcha image. When I uncomment the 'echo' portion, the function works, but all the page does is give me a success message. When I try the header redirect, the page simply comes up blank and doesnt redirect anywhere, or do anything. Can anyone tell me why this is?
---------start code-------------
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
header('Location:http://www.google.com');
//echo "The security code entered was correct.<br /><br />";
}
-------------end code-------------------
Thank you.
header function not working
Moderator: General Moderators
Re: header function not working
You have commented out the start of the echo statement, but not the rest of it, so when it encounters the line:
it crashes out.
Code: Select all
";