Posted by Andy on 09/18/05 21:42
Bellow is a script to ban spammers addresses who are using feedback form to
send spam. I am looking for a script , so I can get all senders IP
addresses. Your help will be appreciated.
And this is my script:
If you would like to ban certain IP addresses from submitting your form,
change "no" to "yes" below.
$ban_ip_on = "no";
IP addresses you would like to ban, seperated only by commas.
$ban_ip_list = "111.222.33.55,11.33.777.99";
Check If IP Address Is Banned.
if($ban_ip_on == "yes") {
if(strstr($ban_ip_list, $HTTP_SERVER_VARS[REMOTE_ADDR])) {
echo "<h2> Error - Banned IP</h2>
You cannot use this form because your IP address has been banned by the
administrator.<br>";
$error = "yes";
}
}
if($error == "yes") {
exit();
}
[Back to original message]
|