ik snap niet waar dit php scriptje niet redirect wanneer ik dat wil ....
Code: Selecteer alles
<?php
$html_401 = "http://www.yourdomain.com/401.html";
$html_403 = "http://www.yourdomain/403.html";
$html_404 = "http://www.yourdomain.com/404.html";
$html_500 = "http://www.yourdomain/500.html";
$mail = 1;
$to = '[email protected]';
$subject= "Error on your website";
$body = "";
$url =getenv("HTTP_REFERER");
$ip=getenv("REMOTE_ADDR");
if(!isset($error)|| empty($error)) {
$error="";
}
if(!isset($page) || empty($page)){
$page="";
}
if($QUERY_STRING == '401'){
$body="there is a 401 error on your website $url $ip ";
$error="401";
$page="$html_401";
Header("Location:error.php?error=$error&page=$page");
}
if($QUERY_STRING == '403'){
$body="there is a 403 forbidden error on your website $url $ip ";
$error="403";
$page="$html_403";
Header("Location:error.php?error=$error&page=$page");
}
if($QUERY_STRING == '404'){
$body="there is a 404 not found error on your website $url $ip ";
$error="404";
$page="$html_404";
Header("Location:error.php?error=$error&page=$page");
}
if($QUERY_STRING == '500'){
$body="there is a 500 internal server error on your website $url $ip ";
$error="500";
$page="$html_500";
Header("Location:error.php?error=$error&page=$page");
}
else{
print "there has been an unknown error !!!!";
}
if($mail ==1){
mail("$to","$subject","$body","$ip");
}
?>
dus om dat ding te testen typ ik erik.userbase.be/zever (404 error ) maar ik krijg altijd "there has been an unknown error" terwijl hij naar 404.php moet redirecten in een .htaccess heb ik staan
Errordocument 404 http://erik.userbase.be/error.php?error=404
ik snap het niet
of moet je nu $_SERVER['QUERY_STRING'] gebruiken ??