0

Hi guys. It's been a third day now, I am having problems with header. I have many included files which output echo before the header, so since I can't output them after the header, I used ob_start(); and ob_flush(); but still I am getting header problems.

If you wanted to created a login code. In which if user enters wrong credietials you might use echo "error";
but it is not working before, echo is being outputted before the header.

Anyone has any solutions for the problem?

5
Contributors
5
Replies
7
Views
4 Years
Discussion Span
Last Post by diafol
0

@Vribium

It's been a third day now, I am having problems with header. I have many included files which output echo before the header, so since I can't output them after the header, I used ob_start(); and ob_flush(); but still I am getting header problems.

Can you post the header code.

0

I had placed ob_start() is the middle, but when I placed it at the VERY top of my codes, it worked just fine. Thank you.

But, it is a good idea to close ob_start() with ob_flush? The site, seems to work just fine without it? Can i leave it there, without expection something bad to happen?

1

You can usually go without ob functions for header redirects if the header appears before any output (php generated or html).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.