ID: 32512 Updated by: [EMAIL PROTECTED] Reported By: kulakov74 at yandex dot ru -Status: Open +Status: Feedback Bug Type: Output Control Operating System: Linux, Win 2000 PHP Version: 4.3.9 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip I can NOT reproduce this with latest CVS (tested PHP_4_3 / HEAD branches) Previous Comments: ------------------------------------------------------------------------ [2005-03-31 10:32:10] kulakov74 at yandex dot ru Description: ------------ We want a script to make a redirect and then make some Sql-queries, so that the user would not wait for the queries to execute (sometimes they may take too long). I added echo("-"); flush(); after sending the Location header which made PHP send the header immediately away, but the problem is IE does not make the redirect as soon as it gets the header - probably it expects other headers or a page, so it only redirects after the script completes. If I add more output after that and a flush() call then PHP won't output anything else until the script completes. This is emulated with a sleep(3) call. More precisely, PHP only sends headers immediately, it doesn't send anything else (the dash in this case). Reproduce code: --------------- //This is the redirect header("Location: http://hotelsys.biz/hotels/Bali"); //This is how I force PHP to send it right away echo("-"); flush(); //This is how I cannot make PHP send anything else echo(str_repeat("-", 1024*16)); flush(); //Pause emulation sleep(3); //the end - this is when the browser gets the output exit; Expected result: ---------------- The first "-" character and the next 16K of it sent right away. Actual result: -------------- I only get dashes in 3 seconds; the browser (IE) makes the redirect in this time too. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32512&edit=1