error.php 811 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<H1>Oops, an error occured!</H1>
<PRE>

<?
 switch($REDIRECT_STATUS) {
   case 500:
    $message = "500 error - internal server error";
    break;
   case 404:
    $message = "404 error - document not found";
    break;
   case 403:
    $message = "403 error - access denied - forbidden";
    break;
   case 401:
    $message = "401 error - authorization required";
    break;
   case 401:
    $message = "400 error - bad request";
    break;
   default:
    $message = "unknown error";
 }
24

Dries's avatar
Dries committed
25
 include "includes/config.inc";
Dries's avatar
Dries committed
26
 include "includes/database.inc"; 
Dries's avatar
Dries committed
27
 include "includes/watchdog.inc";
Dries's avatar
Dries committed
28

29
 watchdog("error", "message: `$message' - requested url: $REDIRECT_URL - referring url: $HTTP_REFERER");
30 31 32 33
?>

<B>Processed output:</B><BR>
  * <? echo $message; ?><BR>
34
  * Return to the <A HREF="">main page</A>.
35
</PRE>