Jump to content

Sending "header" info after HTML?


Solarpitch

Recommended Posts

Hey guys,

 

I am looking to use "header("Location:index.php");" in my code. Basically this will be called when the user logs in to redirect them to the home page but as you expect I get the usual "headers already sent message"

 

Just wondering how to get around this?

 

Do I use the ob_start() method or something? Not quite sure myself

 

Cheers,

Ger.

Link to comment
https://forums.phpfreaks.com/topic/46055-sending-header-info-after-html/
Share on other sites

I am experiencing similar problems with "Warning: Header may not contain more than a single header, new line detected in lib.php line 156"

 

This is the lib that runs thousands of pages but we recently upgraded our php and mysql and now I am getting these errors. Authentication is performed at a login screen with the lib as an include which is listed just above the auth section in top of page. I attempted to inset the ob_start & ob_end_flush lines you referred to in the lib where it references the redirect code but couldn't get it to work. I also did the same thing with the login page at the web site in the <php section and didn't work either.

 

Any ideas what I am doing wrong? :(

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.