note 105453 deleted from features.connection-handling by danbrown

From: Date: Sat, 20 Aug 2011 16:00:31 +0000
Subject: note 105453 deleted from features.connection-handling by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-182605@lists.php.net to get a copy of this message
Note Submitter: kexianbin at diyism dot com ---- Complete version: ignore_user_abort(true);//avoid apache to kill the php running ob_start();//start buffer output echo "show something to user"; session_write_close();//close session file on server side to avoid blocking other requests header("Content-Encoding: none");//send header to avoid the browser side to take content as gzip format header("Content-Length: ".ob_get_length());//send length header header("Connection: close");//or redirect to some url: header('Location: http://www.google.com'); ob_end_flush();flush();//really send content, can't change the order:1.ob buffer to normal buffer, 2.normal buffer to output //continue do something on server side ob_start(); sleep(5);//the user won't wait for the 5 seconds echo 'for diyism';//user can't see this file_put_contents('/tmp/process.log', ob_get_contents()); ob_end_clean();

« previous php.notes (#182605) next »