<?php

$to = 'ip@reinhardt.reno.nv.us'; // The email address you want notifiactaions sent to
$subject = 'Visitors IP'; // What do you want the subject line of notifications to be?

// PHP Script By Dave Lauderdale
// Published at: www.digi-dl.com

$visitorSpecs =
"<hr size=2 width=300 align=left>".
"<b>Visitor IP address:</b> ".$_SERVER['REMOTE_ADDR'].
"<br>".
"<b>Visitor system specs:</b> ".$_SERVER['HTTP_USER_AGENT'].
"<br>";

$headers = "Content-type: text/html \nFrom: IP sniffer script";

$body = "<body>
<br>
<table cellspacing=1 cellpadding=2 align=center>
<tr>
<td>
<b><font face=arial size=2>Website visitors IP address and system specs:</font></b>
</td></tr>
<tr>
<td>
<font face=arial size=2> ".$visitorSpecs." </font>
</td></tr></table>
</body>";

mail($to,$subject,$body,$headers);
?>

<?php
/*
Copyright (C) 2002 Andrew Wilkes andy@urgentclick.com

IP address blocker. Uses a list of full or partial IP addresses.

This code lets you display an alternative web page if an unwanted visitor
looks at your web page.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

http://www.gnu.org/licenses/gpl.html

Modify the list of banned IP addresses to suit your needs.
Include all or some of the IP address from the leftmost digit.
Replace ip1 etc. with a number such as: 198 or 198.201.01.02
Add as many to the list as you like.
Be careful not to exclude everyone from your site!
*/
$iplist = array("152.163.225.101","152.163.225.104 ","152.163.225.98 ","152.163.225."); // the list of banned IPs

$ip = getenv("REMOTE_ADDR"); // get the visitors IP address
// echo "$ip";
$found = false;
foreach ($iplist as $value) { // scan the list
if (strpos($ip, $value) === 0){
$found = true;
}
}

if ($found == true) {
echo "top.location = \"http//www.auntjudysattic.com/error.html\";\n"; // page to divert to
}

?>