* you can completely modify this file :) * file that was distributed with this source code. */ error_reporting(0); /** * Configuration variables. * @param email * @param time zone * $param application name */ $email = 'arunet@gmail.com'; date_default_timezone_set("UTC"); $app_name = 'Name of the application'; /** * Report Error and warnings via Email if it is hosted application , * Otherwise it will display on the same page.. **/ $reporting = TRUE; if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) { $reporting = FALSE; } /** * Overriding error handler function * $e_number will get the error code * $e_message will get the custom error message.. * $e_file file name of the error page * $e_line line number * $e_vars variable state */ function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) { global $reporting, $email; $message = "An error occurred in script '$e_file' on line $e_line: \n
$e_message\n
"; $message .= "Date/Time: " . date('n-j-Y H:i:s') . "\n
"; if(isset($app_name)) { $message .= "Application Name : $app_name \n
"; } $message .= "
" . print_r ($e_vars, 1) . "
\n
"; if ($reporting) { echo '

' . $message . '

'; } else { error_log ($message, 1, $email); // Send email. if ( ($e_number != E_NOTICE) && ($e_number < 2048)) { echo '

A system error occurred. We apologize for the inconvenience. This error has been reported ..Thank you !

'; } } // End of $debug IF. } // End of my_error_handler() definition. /** * Use my error handler: **/ set_error_handler ('my_error_handler'); ?>