[thelist] modification to PHP 404 notification script.... anyone?
John C Bullas
jcbullas at nildram.co.uk
Wed Jan 14 12:22:44 CST 2004
Colleagues, owing to a bounced email I lost touch with the lister who knew
the PHP commands to
return the domain from an IP (WHOIS basically) into the script below......
Below is the php script I use (I munged the addresses) and I wonder if
he/she might adapt it
and post me the undated version
Sorry to clutter the list but archives for detective work on "thelist" seem
difficult to find....
John
=================== 404 notifier script ========
<?php
$ip = getenv ("REMOTE_ADDR");
$requri = getenv ("REQUEST_URI");
$servname = getenv ("SERVER_NAME");
$combine = $ip . " tried to load " . $servname . $requri ;
$httpref = getenv ("HTTP_REFERER");
$httpagent = getenv ("HTTP_USER_AGENT");
$today = date("D M j Y g:i:s a T");
$message = " John Bullas has been informed that:<br>On $today, \n
$combine <br> \n
User Agent = $httpagent <br>\n
$note\n
Referring URL (if any) : $httpref";
$note = "Referring URL:" ;
$message2 = "$today \n
$combine \n
User Agent = $httpagent \n
$note \n
$httpref ";
$to = "johnB at lalalalal.com";
$subject = "404 recorded at www.soton.la.la/lalalal/";
$from = "From: webserver at soton.la.alalal\r\n";
mail($to, $subject, $message2, $from);
echo $message;
?>
More information about the thelist
mailing list