X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP connection_aborted() Function

PHP Misc Reference PHP Misc Reference

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");
?>


Definition and Usage

The connection_aborted() function checks whether the client has disconnected.


Syntax

connection_aborted()

Technical Details

Return Value: Returns 1 if the connection has been aborted, otherwise it returns 0
PHP Version: 4+


PHP Misc Reference PHP Misc Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook