/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function error_handler($errno, $errstr, $errfile, $errline, $errctx) { $host = $_SERVER['HTTP_HOST']; $mail_subject = 'Error at '.$host; $errortype = array(1=>"Error", 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", 2048=>"PHP5 Strict Notice"); $error_handler_string = "<font size=2 face=Arial><h3>Error at ".$host."<br></h3><b>Date: </b>".date('F j, Y, H:i:s a')."<br><b>Error Type: </b>". $errortype[$errno]." (".$errno.")<br><b>Description: <font color=ff0000>".$errstr."</font></b><br><b>Error File: </b>".$errfile."<br><b>Error Line: </b>".$errline."<br><br>"; if( $EN_DESARROLLO ){ }else{ foreach( $mail_to as $mail_to_str ){ mail($mail_to_str, $mail_subject, $error_handler_string, "From: ".$mail_from."\r\nContent-Type: text/html; charset=\"iso-8859-1\"\r\n"); } if ($errno & (E_WARNING | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR)){ } } }