ho scaricato questo codice php per gestire gli errori delle pagine web però non ho capito bene se devo reindirizzare gli errori a questa pagina o ad altre... però, se devo reindirizzare ad altre pagine, lo script come entra in funzione?
Il codice è questo:
Codice PHP:
<?php
$html_401 = "http://www.yourdomain/401.html";
$html_403 = "http://www.yourdomain/403.html";
$html_404 = "http://www.yourdomain/404.html";
$html_500 = "http://www.yourdomain/500.html";
$mail = 1; //do you want e-mail when error occours ? 1=yes 0=no
$to = 'me@localhost.com'; //e-mail addy
$subject= "Error on your website"; //e-mail subject
$body = "";
$url =getenv("HTTP_REFERER");
if($QUERY_STRING == '401'){
$body="there is a 401 error on your website $url ";
Header("Location:$html_401");
}
if($QUERY_STRING == '403'){
$body="there is a 403 forbidden error on your website $url ";
Header("Location:$html_403");
}
if($QUERY_STRING == '404'){
$body="there is a 404 not found error on your website $url ";
Header("Location:$html_404");
}
if($QUERY_STRING == '500'){
$body="there is a 500 internal server error on your website $url ";
Header("Location:$html_500");
}
else{
print "there has been an unknown error !!!!";
}
if($mail ==1){
mail("$to","$subject","$body");
}
?>
Spero che qualcuno mi sappia aiutare.
Ciaoooooooooooo!!!