/ Published in: PHP
Please insert the following code in your PHP script (or create separate file and
and add the code in it. Include the file using "include()")
and add the code in it. Include the file using "include()")
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars) { // Get the error type from the error number 2 => "Warning", 4 => "Parsing Error", 8 => "Notice", 16 => "Core Error", 32 => "Core Warning", 64 => "Compile Error", 128 => "Compile Warning", 256 => "User Error", 512 => "User Warning", 1024 => "User Notice"); $errlevel=$errortype[$errno]; //Write error to log file (CSV format) $linenum\",\"($errlevel) $errmsg\" "); if($errno!=2 && $errno!=8) { //Terminate script if fatal error } }