PHP Custom Error handler

xiaoxiao2021-03-06  97

Function user_define_error_handle ($ ErrorNo, $ ErrorMessage, $ Errorfile = __File__, $ ErrorLine = __LINE__)

{

$ ErrorContent = "

error: $ ErrorMessage

please try again, or contact us and tell US That

"file '". $ ERRORLINE. "";

IF ($ error || $ error)

{

$ ErrorContent. = "

this error WAS FATAL, PROGRAM Ending";

$ ERRORCONTENT. = "
";

Echo $ ErrorContent;

EXIT;

}

$ ERRORCONTENT. = "
";

Echo $ ErrorContent;

// You can also add other functions such as sending an email to the technical support staff ETC.

Mail ();

}

SET_ERROR_HANDLER ("user_define_error_handle);

FOPEN ("Gotodie", "R"); // Trigger Error

Trigger_ERROR ("Trigger Function Called", E_USER_NOTICE;

?>

转载请注明原文地址:https://www.9cbs.com/read-122101.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.039, SQL: 9