[PHP] ob_output
Hi! here is my test code ?php ob_start(); for ($n=1;$n10;$n++) { echo testbr; ob_end_flush(); sleep(2); } ? I can make this work on php and apache. I always get output in one shot not line by line. If i try this code with php and iis it works. What am i doing wrong. Do i have to tell apache to send line by line to browser not everything together. -- lp, Uros -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_output
On Fri, 22 Nov 2002, Uros Gruber wrote: ob_end_flush(); This turns off output buffering after flushing, the first time it gets called in the first iteration of your for() loop. I can make this work on php and apache. I always get output in one shot not line by line. If i try this code with php and iis it works. Try using ob_flush() instead. http://www.php.net/ob_flush This function does not destroy the output buffer like ob_end_flush() does. What's odd is that it works like you want it to in IIS g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] ob_output
Hi! I changed it to ob_flush() and the problem still exist. Check the link and you'll se. http://www.kud-igen.si/link.php I have 3 apache servers and no one works as i want to. But iis makes no problems. -- bye, Uros Friday, November 22, 2002, 8:32:56 PM, you wrote: CW On Fri, 22 Nov 2002, Uros Gruber wrote: ob_end_flush(); CW This turns off output buffering after flushing, the first time it gets CW called in the first iteration of your for() loop. I can make this work on php and apache. I always get output in one shot not line by line. If i try this code with php and iis it works. CW Try using ob_flush() instead. http://www.php.net/ob_flush CW This function does not destroy the output buffer like ob_end_flush() CW does. CW What's odd is that it works like you want it to in IIS CW g.luck, CW ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_output
You need to use flush() to try and send a chunked response that will display on the user's browser line at a time like that. Output buffering is fairly closely related I suppose, but it is a separate thing. As far as I know, you cannot flush() with output buffering started unless you end or flush that output buffering first. However, output buffering is not required for what you are wanting to do, so only use it if you also need that. I wrote a quick little example of displaying a bulleted list one item at a time that might be helpful to you: http://shiflett.org/tutorials/php_flush.txt Chris --- Uros Gruber [EMAIL PROTECTED] wrote: ?php ob_start(); for ($n=1;$n10;$n++) { echo testbr; ob_end_flush(); sleep(2); } ? I can make this work on php and apache. I always get output in one shot not line by line. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php