########################################### #Very simple ERROR script. #Script says error when visitors get errors from your page like 404 error. #To use it simple upload all files to your main directory. #The most important is to upload .htaccess file. If you have already simple change there lines.(read readme for details.) #Do not forget to upload error html pages as well.(you can make them for your choice if you want.) #Do not forget to change html paths. #If you have problems you can contact webmaster@dony.com.kg #This script is free of charge. Do not hesitate to suggest this script to your friends. #Thanks for using this script. #www.dony.com.kg ########################################### #change this to your html pages if you have changed them. //You can use full url like http://mypage.com/404.htm $error_dir = "http://boutique.info-grece.com/error_pages/"; $htm_401 = "401.htm"; $htm_404 = "404.htm"; $htm_403 = "403.htm"; $htm_500 = "500.htm"; $htm_503 = "503.htm"; $mail = 0; //if you want to be informed about broken link. $to = 'webmaster@info-grece.com'; //your email. $subject = "Error ".$_SERVER['QUERY_STRING']." from website"; //subject of mail if (isset($_SERVER['HTTP_REFERER'])) { $refering_url = $_SERVER['HTTP_REFERER']; } else { $refering_url = 'unknown'; } if (isset($_SERVER['HTTP_USER_AGENT'])) { $navigateur = 'Navigateur : ' . $_SERVER['HTTP_USER_AGENT']; } else { $navigateur = ''; } if (isset($_SERVER['REMOTE_ADDR'])) { $addresse_ip = 'Adresse IP:' . $_SERVER['REMOTE_ADDR']; $nom_de_domaine = 'Nom de domaine: ' . gethostbyaddr($_SERVER['REMOTE_ADDR']); } else { $addresse_ip = ''; $nom_de_domaine = ''; } if (isset($_SERVER['REQUEST_URI'])) { $page_origine = 'page d\'origine:' . $_SERVER['REQUEST_URI']; } else { $page_origine = ''; } //echo "e:".$error.dirname(__FILE__); //exit(); #nothing else to change. Leave this section as is. switch ($_SERVER['QUERY_STRING']) { //switch ($error) { case "401": //acces protege // $mail = 1; $mailbody="There is 401 error url=".$refering_url; // header ("Location: $error_dir$htm_401"); include ("$htm_404"); break; case "403": //acces interdit // $mail = 1; $date = date("d-m-Y"); $heure = date("H:i"); $warning="\n
Les renseignements suivants ont ete enregistres :
\n\n
- $navigateur\n
- $addresse_ip\n
- $nom_de_domaine\n";
// $to="votre_mail@votre_domaine.com";
// $sujet="Erreur 403";
$message="\nUne erreur 403 s'est produite.\n\n
Page : ".$SCRIPT_URI."\n$navigateur\n$addresse_ip\n$nom_de_domaine\n";
// @mail($to,$sujet,$message,"From: erreur403@hebergeur_gratuit.fr");
// echo("
L'affichage de cette page est interdit.
403
Votre navigateur est non conforme ou mal configure.
Veuillez contacter le webmaster en cliquant ici.
"); // echo(""); $mailbody = "There is 403 error url=".$refering_url."\n\n$warning"; // header ("Location: $error_dir$htm_403"); include ("$htm_403"); break; case "404": // page not found $mail = 0; //if you want to be informed about broken link. $mailbody = "There is 404 error url=".$refering_url; $mailbody .= "\nUne erreur 404 s'est produite.\n\n" . "$page_origine\n$navigateur\n$addresse_ip\n$nom_de_domaine\n"; // header ("Location: $error_dir$htm_404"); include ("$htm_404"); // exit(); break; case "500": $mail = 0; //if you want to be informed about broken link. $mailbody = "There is 500 error url=".$refering_url; // header ("Location: $error_dir$htm_500"); include ("$htm_500"); break; case "503": $mail = 0; //if you want to be informed about broken link. $mailbody = "Le site est en maintenance. Nous travaillons pour qu'il soit de nouveau accessible le plus rapidement possible. Veuillez svp revenir plus tard."; // header ("Location: $error_dir$htm_500"); header('HTTP/1.1 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 3600'); include ("$htm_503"); //echo "e:".$error.dirname(__FILE__);exit(); break; default: print "Unknown error!"; break; } if ($mail == 1){ mail($to,$subject,$mailbody); }