note 95300 deleted from function.flush by danbrown
| From: | danbrown@php.net | Date: | Wed, 14 Apr 2010 18:45:58 +0000 |
| Subject: | note 95300 deleted from function.flush by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168243@lists.php.net to get a copy of this message | ||
Note Submitter: kurtz8763 at gmail dot com
----
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;
?>