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
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.

 

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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.