...

View Full Version : Outputting and ending buffer early



TheBlueblib
06-18-2010, 05:34 PM
I would like a php script to submit it's output to the browser and continue to run code. For example:

<?php
echo "This is my output";
ob_end_flush(); //The browser has completely loaded the page
sleep(100);
//work goes here
?>


With the above script, from the browser's point of view, the page will have loaded instantly with the words "This is my output" and not for 100 seconds. The script however will continue to run code without any dependence on the browser's connection.

ob_end_flush() did not work as I wanted it to, I don't know if that's even it's intended purpose. How can I go about doing this?

xGIHavoc
06-19-2010, 09:26 AM
Look at the responses at PHP's documentation page on the sleep page: http://php.net/manual/en/function.sleep.php. From what I can infer it is browser dependent and can have problems with flushing output.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum