This will email you the spammers ip address and then you can ban by single ip or by range.
I have set up 2 parts. 1 part is in gbookphp
at the top of the script above:
error_reporting(E_ALL ^ E_NOTICE);
I added:
$ipaddr = $_SERVER["REMOTE_ADDR"];
*****----------------------------------------------------------------*****
I modified the notification portion as follows(around line 460):
*****--------------------------------------------------------------******
if ($settings['notify'] == 1)
{
$ipaddr = $_SERVER["REMOTE_ADDR"];
$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$message = "Hello!
Someone has just signed your guestbook!
Name: $name
From: $from
E-mail: $email
Website: $url
IP Address: $ipaddr
****------------------------------------------------------------------****
that will send the ip address in the notification email.
in the header.txt file I changed as follows:
****------------------------------------------------------------------*****
<html>
<?php
$timedate = date("F j, Y, g:i a");
$usr = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
$ipaddr = $_SERVER["REMOTE_ADDR"];
$range = array('0'=>'172.201.32.26',
'1'=>'81.177.15'
);
foreach($range as $list){
if(strstr($_SERVER['REMOTE_ADDR'], $list)){
?>
***-----PLACE ANY HATE SPAM OR BANNED HTML HERE!!!----*****
<?
die;
}
else
{
?>
-----*****BELOW IS MY CUSTOM PAGE, PLEASE USE YOURS OR YOU WILL GET A PINK / PURPLE PAGE. PLEASE USE YOUR HEADER INFO -----*****
<head><title>Welcome to Guestbook</title></head>
<body bgcolor="#555555" link="blue" vlink="blue" alink="red" topmargin="0" marginheight="0" style="font-family:verdana" background="
http://yourwebsite.com/images1/bkgr.jpg">
<center>
<br><br>
</center>
</body>
</html>
<?
}
}
?>