|
Posted by Petr Vileta on 10/29/06 14:08
"Jerry Stuckle" <jstucklex@attglobal.net> píse v diskusním príspevku
news:AdydnSBDeabyg9nYnZ2dnUVZ_oWdnZ2d@comcast.com...
> laredotornado@zipmail.com wrote:
>> Hi,
>>
>> I'm using PHP 4.4.4. What is the header I need to send in order for
>> output to be continuously sent to the client browser as opposed to it
>> being buffered and all sent at once?
>>
>> Thanks, - Dave
>>
>
> Dave,
>
> There aren't any headers you can send. However, you can cause the data to
> be sent to the browser immediately with:
>
> ob_flush();
> flush();
>
> This will cause PHP to flush the output immediately, and generally Apache
> will do the same. Whether or not it will be displayed immediately,
> however, is up to the browser.
>
And a little trick for browser is to send 1024 or more spaces anywhere where
it is possible in html content.
Example:
<p>some text which should be unbuffered</p>
......1024 spaces here...
<?php ob_flush(); flush(); ?>
<p>another text</p>
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
[Back to original message]
|