Thanks for you help and so far I have managed to start grabbing IPs and inserting them into a field in my MySQL database using the following:
Code: Select all
<input type="hidden" name="ip"
value="<?PHP
if (!empty ($_SERVER['REMOTE_HOST'] )){
print $_SERVER['REMOTE_HOST'];
} else if (!empty($_SERVER['REMOTE_ADDR'])){
print gethostbyaddr($_SERVER['REMOTE_ADDR']);
} ?>">
Already I have used this on two sites and so far I have received the following IP’s which have been inserted into the database ( both exactly the same IP):
dialup.82.209.210.18.belpak.gomel.by
I have then setup a .htaccess page and inserted the following in the hope that I can block this somewhat:
Code: Select all
<Limit GET POST>
order allow,deny
allow from all
deny from dialup.82.209.210.18.belpak.gomel.by
</Limit>
So based on all of this I have a few questions. Firstly I appreciate that this is probable very basic method with lots of workarounds but as I’m so beginning PHP and have never done this before I’m pleased that I have got this little result so far.
I appreciate that the IP can change too so I’m open to try and further develop this bit if script.
Also how do I add more than one IP to the following part of the script?
‘dialup.82.209.210.18.belpak.gomel.by’ for example if I try to add using a ‘,’ it seems to ignore the script e.g. dialup.82.209.210.18.belpak.gomel.by, 123.456.789 etc
So far blocking this IP has stopped the 4 or more a day spam entries that were going into this guestbook!
Thanks very much for all you help
Brian