Jump to content

Simple question about ob_start


bugzy

Recommended Posts

I have just uploaded my 1st website project in my online server and the 1st error that I got is something like "Header ouput buffer" error. I have research on how to solve it and and I read that ob_start() will solve it.

 

I have use it on the file that I'm having problem with and it instantly solve the problem.

 

 

My question is...

 

 

Is it always always ok to use it? I mean will it cause a slow page load or any conflicting errors that I might encounter in the future?

 

another thing is...

 

do I always need to end it? like put this end code "ob_end_flush(); " at the end of the line or it isn't necessary anymore?

Link to comment
https://forums.phpfreaks.com/topic/261715-simple-question-about-ob_start/
Share on other sites

There is a sticky for this at the top of this forum. http://www.phpfreaks.com/forums/index.php?topic=37442.0

 

And no, this is not what output buffering is for. This is but a quick band-aid, but it is not a solution.

 

You need to move your presentation logic out of your business/application logic.

There is a sticky for this at the top of this forum. http://www.phpfreaks.com/forums/index.php?topic=37442.0

 

And no, this is not what output buffering is for. This is but a quick band-aid, but it is not a solution.

 

You need to move your presentation logic out of your business/application logic.

 

I actually read that sticky but it is locked so I can't post my question there.

 

To my questions.. I just need the pros and cons of using it..

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.