PHP connection_aborted() Function
Complete PHP Misc Reference
Definition and Usage
The connection_aborted() function checks whether the client has disconnected.
This function returns 1 if the connection has been aborted, otherwise it
returns 0.
Syntax
Example
Create a function (check_abort()) that writes a log message if a client
aborts the script:
<?php
function check_abort()
{
if (connection_aborted())
error_log ("Script $GLOBALS[SCRIPT_NAME]" .
"$GLOBALS[SERVER_NAME] was aborted by the user.");
}
//some script to be executed here
// Call the check_abort function when the script ends
register_shutdown_function("check_abort");
?>
|
Complete PHP Misc Reference
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 4000 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|