header function not working
Posted: Thu Aug 04, 2011 10:29 am
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.
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.