Forum Moderators: coopster
for example if someone clicks on www.mysite.com/123.php or www.mysite.com/78.php I would like to extract 123 or 78 strings. How?
I tried both $_SERVER['PHP_SELF'] and $_SERVER['HTTP_REFERER'] but Apache does not sent the original not found URl to my 404.php page.
Any code/help would be appricated.
I would like to be able to setup my custome 404.php file and after extracting the number in url display dynamic pages.
Thanks for reading and any feedback
-Reza
Anyway, this is the function I use in my 404 page. It just send you an email with the following information :
function send_error_email( $error_code='Undefined' )
{ $to = '#*$!@xxxx.xx';
$subject = "An error at xxxxx - type: $error_code";
$message = "The following error has occured:\r\n"
."--------------------------------\r\n\r\n"
." Type: $error_code\r\n"
." Page: {$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}\r\n"
." From page : {$_SERVER['HTTP_REFERER']}\r\n"
." Time: ".date('d/m/Y H:i:s')."\r\n"
." From IP: {$_SERVER['REMOTE_ADDR']}\r\n\r\n"
."Regards,\r\n"; email($to, $subject, $message);}
Do not forget to add this line in the 404page to call the function.
send_error_email("404");
Give it a try and let us know.