Hướng dẫn php connection_status
❮ PHP Misc Reference ExampleReturn the connection satus: switch (connection_status()) echo $txt; Try it Yourself » Definition and UsageThe connection_status() function returns the current connection status. Possible values that can be returned are:
SyntaxTechnical Details
❮ PHP Misc Reference Internally in PHP a connection status is maintained. There are 4 possible states:
When a PHP script is running normally, the NORMAL state is active. If the remote client disconnects, the ABORTED state flag is turned on. A remote client disconnect is usually caused by users hitting their STOP button. If the PHP-imposed time limit (see set_time_limit()) is hit, the TIMEOUT state flag is turned on. You can decide whether or not you want a client disconnect to cause your script to be aborted. Sometimes it is handy to always have your scripts run to completion even if there is no remote browser receiving the output. The default behaviour is however for your
script to be aborted when the remote client disconnects. This behaviour can be set via the ignore_user_abort php.ini directive as well as through the corresponding Your script can also be terminated by the built-in script timer. The default timeout is 30 seconds. It can be changed using the max_execution_time php.ini directive or the
corresponding One thing to note is that both the ABORTED and the TIMEOUT states can be active at the same time. This is possible if you tell PHP to ignore user aborts. PHP will still note the fact that a user may have broken the connection, but the script will keep running. If it then hits the time limit it will be aborted and your shutdown function, if any, will be called. At this point you will find that connection_status() returns 3. tom lgold2003 at gmail dot com ¶ 13 years ago
'Text user will never see'); arr1 at hotmail dot co dot uk ¶ 15 years ago
mheumann at comciencia dot cl ¶ 9 years ago
a1n2ton at gmail dot com ¶ 12 years ago
Lee ¶ 18 years ago
Marco ¶ 5 years ago
Anonymous ¶ 14 years ago
Ilya Penyaev ¶ 9 years ago
?>
pulstar at mail dot com ¶ 19 years ago
Anonymous ¶ 10 years ago
Jean Charles MAMMANA ¶ 14 years ago
robert at go dot rw ¶ 6 years ago
|