|
 |
|
custom server error page จากที่ถามกระทู้ที่แล้วนะครับ เรื่อง custom server error page |
|
 |
|
|
 |
 |
|
จากที่ถามกระทู้ที่แล้วนะครับ
เรื่อง custom server error page
ได้โค๊ดนี้มาจาก -=[ANT]=- อยากรบกวนถามว่าต้องทำอะไรเพิ่มอีกหรือปล่าว หมายถึงการตั้งค่าใน server
หรืออื่นๆ พอดีผมเอาไปลองทำแล้วไม่ได้อ่าครับ
<?php
if(@$_GET["err"]!="") { exit($err); };
$old_error_handler = set_error_handler("myErrorHandler");
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
$errorpage = "index.php";
$errortype = array (
E_ERROR => "Error",
E_WARNING => "Warning",
E_PARSE => "Parsing Error",
E_NOTICE => "Notice",
E_CORE_ERROR => "Core Error",
E_CORE_WARNING => "Core Warning",
E_COMPILE_ERROR => "Compile Error",
E_COMPILE_WARNING => "Compile Warning",
E_USER_ERROR => "User Error",
E_USER_WARNIN => "User Warning",
E_USER_NOTICE => "User Notice",
E_STRICT => "Runtime Notice"
);
$dt = date("Y-m-d H:i:s (T)");
$err = "$dt\n";
$err .= "$errno [$errortype[$errno]]\n";
$err .= "$errfile [line $errline]\n";
$err .= "$errstr\n";
$err .= "Please contact admin as needed to report any problems you may be having.\n";
$err = eregi_replace("\n", "<br>", $err);
header("Location: $errorpage?err=$err");
exit();
}
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-02-27 19:14:56 |
By :
maccit |
View :
1261 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 00
|