ob-start

why ob_start() must come ahead of session_start() to work in PHP?

I don't think it's reasonable. Why is it actually such a rule? ...

The strangest thing with ob_start and headers

ob_start and all the headers did not work on my webpage. I searched though my whole code and did not find anything wrong. Then I deleted all my code and placed a Header Location at the top of the dokument and it still didnt work so then I simply created a new document copied the code from the old document and then all of sudden it starte...

how to use ob_start?

Hello I am using PHPSavant templating system for a project and I am not sure how to use ob_start in this. I have tried before .. for example, page_header.php -- ob_start(); page_footer.php -- ob_end_flush(); But because now I am using a templating system.. am not sure where to put these function. $template = new Savant3(); $templ...

ob_start() -> ob_flush() doesn't work

I am using ob_start()/ob_flush() to, hopefully, give me some progress during a long import operation. Here is a simple outline of what I'm doing: <?php ob_start (); echo "Connecting to download Inventory file.<br>"; $conn = ftp_connect($ftp_site) or die("Could not connect"); echo "Logging into site download Inventory file.<br>"; ftp_...

How to tell if ob_gzhandler is working?

How can I check to see if ob_start("ob_gzhandler"); is working and test the difference with or without it? Thanks, ...

Insert Values after Compiler has passed Line

To start, I am using PHP with ob_start() and ob_flush. In the code I have a part where parameters are suppose to be dynmacially loaded in the head of a file. <head> <script type="text/javascript" src="javascript/ajax_objects.js"></script> //Enter More Code Here Later </head> What I am trying to is after the compiler has finished an...

Whats the point of using ob_start without any parameters in PHP

OK, I can see the use of ob_start with the output_callback parameter set but I can't see the use of ob_start when calling it without any parameters set at all. Whats the point of disabling output to later throw all the output at once? Don't this use more memory (server side) and slow downloads (client side) since the download starts onl...

PHP's ob_flush() causing error

When I call PHP's ob_flush() function on my localhost (via MAMP) I get the following error: Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. The only solution I can find is to prefix it with @, but this doesn't seem like a real solution to me. What's causing the problem? ...

PHP - ob_start("ob_gzhandler") why the function not use directly in zend framework project?

Hi, I beginer in zend framework. ob_start("ob_gzhandler") - why the function not use directly in zend framework project? (does ob_start("ob_gzhandler") used auto in zend framework? ) Thanks ...

Using OB to capture error?

Hello, Here is an example. Is it possible to save the output buffer. I would like to cache what its going to output. header('Content-type: text/css'); ob_start("compress"); function compress($buffer) { $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); $buffer = str_replace(array("\r\n", "\r", "\n", "\t", '...

PHP: Output data before and after sleep()?

This is purely for learning more about output buffering and nothing more. What I wish to do is echo a string to the browser, sleep 10 seconds, and then echo something else. Normally the browser would wait the full 10 seconds and then post the whole result, how I would I stop that? An example: ob_start(); echo "one"; sleep(10); echo "two...

how to start ob_start inside a class ?

im doing a little reasearch about minimalizing the html from php. like class themeing { function render( $file, $folder ) { if ( COMPRESS ) { // this is the problem ob_start('compressor'); } $get = VIEWS . $folder . '/' . $file . '.phtml'; if ( COMPRESS ) { o...