Jump to content
MakeWebGames

Warning: Cannot modify header information [FIX]


Recommended Posts

Posted

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 ;)

  • 2 weeks later...
Posted

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 ;)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...