I have a php page as the page that opens when you have a 404 error on the site, and I wanted to use a database to store the referring URL, the URL thats broken, and the date.
The function i'm useing to store this is:
function errorpages(){
$date=date("Y-m-d",mktime()+3600);
$to=$_SERVER['REQUEST_URI'];
$from=$_SERVER['HTTP_REFERER'];
$query="INSERT INTO `errorspages` (`date` , `pageto` , `pagefrom` ) VALUES ('$date', '$to', '$from');";
$SQLresult=mysql_query($query);
}
The date and referring URL appear to be working correctly, but the $_SERVER['REQUEST_URI'] variable is giving me the URL for the 404 error page, not the page that was not found.
Anyone know how i can get the page that was not found?
Thanks
David