ignore_user_abortDescriptionignore_user_abort() allows developers to control whether a remote client can abort the running of a script. If the user_abort_setting argument is set to FALSE, client aborts (and some network errors) will cause the script to stop running. If user_abort_setting is set to TRUE, the script continues running until an error occurs, the script finishes execution, or the script times out.
NoteRegardless of the ignore_user_abort() setting, no output will be sent to the client's browser after an attempt to abort the script. See connection_aborted() for information on how to deal with an aborted script. ExampleExample 186. Help a disconnected client resume a session without cookies // Assume that we are using a system where clients log in // ...and we know their email addresses // this should go at the top of the script ignore_user_abort (TRUE); // this should go at the bottom of the script if (connection_aborted () && $user_prefs['resume_session']) { $message = "Dear $user->name, It looks like either you lost your connection or pressed stop while viewing a script at www.e-foo.com. To resume your session, visit this link: http://www.e-foo.com/recover_session/" . SID . ". To avoid receiving these kinds of messages in the future, please visit http://www.e-foo.com/preferences and disable the resume connection feature. Thank You! The e-foo team"; mail ($user->email, "Connection Lost", $message); }
PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing
(Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch).
This material may be distributed only subject to the terms and conditions set forth
in the Open Publication License, v1.0 or later (the latest version is presently available at
http://www.opencontent.org/openpub/).
The authors of this book have elected not to choose any options under the OPL. This online book was obtained
from http://www.fooassociates.com/phpfer/
and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4
for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All
persons and entities shall have neither liability nor responsibility to any person or entity with respect to
any loss or damage arising from the information contained in this book.
|