Quote:
Originally posted by ab8140
Ok, I have a logout page where I would like to redirect users back to the login page. I use this command
header("Location:login.php");
but I recieve an error on the page that says:
Warning: Cannot modify header information - headers already sent by (output started at /home/stu/ab8140/public_html/onboard/check_login.php:66) in /home/stu/ab8140/public_html/onboard/logout.php
Any suggestions on why this is occuring?
|
Try using the follwing statement:
echo("<HEAD><META HTTP-EQUIV=Refresh CONTENT='3; URL=$PHP_SELF'</HEAD>");
content=3 is how long you want to wait before the redirection
url = is the page you want to redirect to.
This does not work in all browsers, but has worked for me. The problem you are having is that I do not think you can use the header function if you have displayed anything on the screen already.