bugzy Posted April 27, 2012 Share Posted April 27, 2012 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? Quote Link to comment https://forums.phpfreaks.com/topic/261715-simple-question-about-ob_start/ Share on other sites More sharing options...
scootstah Posted April 27, 2012 Share Posted April 27, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/261715-simple-question-about-ob_start/#findComment-1341127 Share on other sites More sharing options...
bugzy Posted April 27, 2012 Author Share Posted April 27, 2012 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.. Quote Link to comment https://forums.phpfreaks.com/topic/261715-simple-question-about-ob_start/#findComment-1341130 Share on other sites More sharing options...
scootstah Posted April 27, 2012 Share Posted April 27, 2012 Pros: it works. Cons: your application is still broken. Quote Link to comment https://forums.phpfreaks.com/topic/261715-simple-question-about-ob_start/#findComment-1341131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.