note 101969 added to features.connection-handling
| From: | foobuilder at gmail dot com | Date: | Thu, 20 Jan 2011 18:38:12 +0000 |
| Subject: | note 101969 added to features.connection-handling | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175945@lists.php.net to get a copy of this message | ||
Simplified the solution a bit:
<?php
header('Connection: close'); // Tell the client to close the connection.
header('Content-Length: 0'); // Tell the client not to expect any data.
flush(); // Render the headers which disconnects the client before the rest of the script executes.
sleep(60);
error_log('It works!');
?>
The trick is to make sure nothing is sent to the client before you set the headers.
----
Server IP: 69.147.83.197
Probable Submitter: 173.13.145.110
----
Manual Page -- http://www.php.net/manual/en/features.connection-handling.php
Edit -- https://master.php.net/note/edit/101969
Del: integrated -- https://master.php.net/note/delete/101969/integrated
Del: useless -- https://master.php.net/note/delete/101969/useless
Del: bad code -- https://master.php.net/note/delete/101969/bad+code
Del: spam -- https://master.php.net/note/delete/101969/spam
Del: non-english -- https://master.php.net/note/delete/101969/non-english
Del: in docs -- https://master.php.net/note/delete/101969/in+docs
Del: other reasons-- https://master.php.net/note/delete/101969
Reject -- https://master.php.net/note/reject/101969
Search -- https://master.php.net/manage/user-notes.php