View Single Post
Old 12-09-2005, 09:38 PM   PM User | #1
JamieR
Senior Coder

 
JamieR's Avatar
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 3,161
Thanks: 0
Thanked 5 Times in 5 Posts
JamieR is on a distinguished road
Simple error manager

PHP Code:
<?php

switch ($_GET['type']) 
{
case 
404:
$error 'Error 404 has occured';
$error_message 'The Page You Requested cannot be Found.';
break;
 
case 
403
$error 'Error 403 has occured';
$error_message 'You are not allowed to view this page or directory.';
break;

case 
500:
$error 'Error 500 has occured';
$error_message 'Either your page cannot be found or there has been a script error. Please notify the Administrators.';
break;

case 
401;
$error 'Error 401 has occured';
$error_message 'This server could not verify that you are authorized to access the specified URL. You either supplied the 

wrong credentials (e.g. bad password), or your browser does not understand how to supply the credentials required.'
;
break;

case 
400;
$error 'Error 400 has occured';
$error_message ' Error 400 - Your browser (or proxy) sent a request that this server could not understand.';
break;
}

if (
$error == false && $error_message == false) { /*If no error has occured (denoted by $error and $error_message not being 

set*/

echo '<p>' 'No error has occured' '</p>';
} else {

echo 
'<h1>' $error .'</h1>';
    echo 
'<p>' $error_message '</p>';

}

?>
an easy way to manage all your Apache/IIS error messages from one file. Just had it lying around so I thought I'd post it.
__________________
-Jamie
JamieR is offline   Reply With Quote