note 95300 added to function.flush

From: Date: Fri, 25 Dec 2009 06:07:42 +0000
Subject: note 95300 added to function.flush
Groups: php.notes 
Request: Send a blank email to php-notes+get-164316@lists.php.net to get a copy of this message
IE 8 was refusing to follow my redirect until the end of script execution, so I added this and it worked just fine: header("Content-Length: 0"); Full code (function code from: 'mandor at mandor dot net' below) <?php header("Cache-Control: private, no-cache, must-revalidate"); header("Content-Length: 0"); header("Location: {$link}"); flush_now(); // "Hasta la vista... Baby." $headers_sent = headers_sent(); sleep(10); // "You're getting very drowsy..." exit; function flush_now() { @apache_setenv('no-gzip', 1); @ini_set('output_buffering', 0); @ini_set('zlib.output_compression', 0); @ini_set('implicit_flush', 1); for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } ob_implicit_flush(1); return true; } ////////////////////////////////////////// // Output: // $headers_sent == true; ?> ---- Server IP: 69.147.83.197 Probable Submitter: 76.247.173.69 ---- Manual Page -- http://www.php.net/manual/en/function.flush.php Edit -- https://master.php.net/note/edit/95300 Del: integrated -- https://master.php.net/note/delete/95300/integrated Del: useless -- https://master.php.net/note/delete/95300/useless Del: bad code -- https://master.php.net/note/delete/95300/bad+code Del: spam -- https://master.php.net/note/delete/95300/spam Del: non-english -- https://master.php.net/note/delete/95300/non-english Del: in docs -- https://master.php.net/note/delete/95300/in+docs Del: other reasons-- https://master.php.net/note/delete/95300 Reject -- https://master.php.net/note/reject/95300 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#164316) next »