Welcome Guest, Not a member yet? Register   Sign In
Loading message and output_buffering
#1

[eluser]rockacola[/eluser]
Hi guys, this is a separate thread continued from http://ellislab.com/forums/viewthread/104240/.

Part of the problem I encountered with one of my project today was output_buffering.

output_buffering was set to off by default in PHP (meanwhile it is 4KB by default in PHP). With modifying php.ini out of the question.. This warning message is now all over the place
Quote:A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /usr/home/rockacol/public_html/system/application/controllers/user.php:465)

Filename: libraries/Session.php

Line Number: 662
After bit of troubleshooting and reading in thread:
http://ellislab.com/forums/viewthread/73299/
http://ellislab.com/forums/viewthread/45181/

I realised my 'Loading...' message was in the way and that's what's causing the problem.

Currently, I have implementation like this all over different controllers:
Code:
function do_something($args=array())
{
    // Credential and Authorization

    // Page Status
    echo "Updating something... please wait";
        
    // Implementations...
    
    // Redirect back to previous page
    redirect('post-action-page', 'refresh');
}

I had no problem with this in PHP, which gives me a similar effect to when you log into CI forum.
Does this mean 'echo' before redirect is not a good practise? What's a better solution to this??


Messages In This Thread
Loading message and output_buffering - by El Forum - 02-01-2009, 12:55 AM
Loading message and output_buffering - by El Forum - 02-01-2009, 07:23 AM
Loading message and output_buffering - by El Forum - 02-01-2009, 04:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB