= 3){ $mail = "Severity: $severity\n" . "Message: $message\n". "Code: $file/$line\n". "Log ID: ".mysql_insert_id() ."\n". "SERVER: ".print_r($_SERVER, true)."\n". "REQUEST: ".print_r($_REQUEST, true)."\n". "SESSION: ".print_r($_SESSION, true)."\n"; @mail(ADMIN, "flexicon Error", $mail, "From: error@flexicon.com"); } } //stop execution if it is a really bad error if($severity >= 5){ defaultErrorPage("", $code); } } /** shows a default error page * @param message error message */ function defaultErrorPage($message="", $code=500){ header('X-PHP-Response-Code: ' . $code, true, $code); $t = new Template(TEMPLATE_DIR."errorpage.html"); $t->setVar("MESSAGE", $message); die($t->toString()); } /** check if the request came from a bot * @return boolean true if it is a bot */ function isBot() { if (isset($_SERVER['HTTP_USER_AGENT'])) { return strpos($_SERVER['HTTP_USER_AGENT'], 'bingbot') !== false; } return false; } ?>