Uridium Posted November 18, 2009 Posted November 18, 2009 I have just spent the best part of 2 hours trying to fix an issue Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\mcctest\authenticate.php:3) in C:\xampp\htdocs\mcctest\authenticate.php on line 60 I searched through all the files i had amended after the Error Message Occured checked for blank lines unevenly spaced tags Even got on CrazyT's Nerves ;) But alas i seem to have solved the issue So for future use to those that are having or those that may have the above issue open up authenticate.php and look for header("Location: loggedin.php"); And delete the damn thing or use //header("Location: loggedin.php"); and in its place put echo "<script>document.location.href='loggedin.php'</script>"; echo "<script>'Content-type: application/octet-stream'</script>"; And Hey Presto to the man in the iron mask its Cured ;) Quote
a_bertrand Posted December 1, 2009 Posted December 1, 2009 a header with a redirection or a script is NOT the same thing. I would personally always use a redirection if possible as it's much faster and works even if people disable JavaScript. To solve your problem you may also enable the buffering in the php.ini and PRESTO your problem would have been fixed as well ;) Quote
Uridium Posted December 2, 2009 Author Posted December 2, 2009 Thats is also true Alain but not all Hosts provide users with access to the php.ini file so this i suppose will be just as good Quote
a_bertrand Posted December 2, 2009 Posted December 2, 2009 True, but you will however need to use headers for example to set cookies, or change content-type. So knowing what does an echo or using a buffering is something needed in my opinion. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.