I would never want to approve a message. Especially getting an email every 30 seconds.
Jcart, that could be useful. However, I dont' need it. I wrote my script to automatically check for spam (for instance, every message he has says "Thanks", so if the message has "Thanks" + "<a" + "http", then do the ban procedures.)
I also have my script set to ban someone who:
-Tries to post PHP "<?"
-Tries to post 3 or more URLs
No one would have to post 3 URLs, hell, they shouldn't even have to post 1. It's just.. like a guestbook.
Code: Select all
if ($ShoutName && $ShoutEmail && $ShoutInfo) {
//Get the number of the following
$dex1 = substr_count("$ShoutInfo","http");
$dex2 = substr_count("$ShoutInfo","www.");
$dex3 = substr_count("$ShoutInfo","<a");
$dex4 = substr_count("$ShoutInfo","<?");
$dex5 = substr_count("$ShoutInfo","Nice site. Thank you");
$dex6 = substr_count("$ShoutInfo","Cool site. Thank you");
$dex7 = substr_count("$ShoutInfo","Thank");
//End of getting numbers
if ($dex1 > 2 || $dex2 > 2 || $dex3 > 1 || $dex4 > 0 || $dex5 > 0 || $dex6 > 0 || $dex7 > 0) { //If the message has any of these then
$Reason = "Unknown"; //Set default reason
if ($dex1 > 2 || $dex2 > 2) { //If message has 3+ "www." and 3+ "http"
$Reason = "URL Spammer";
}
if ($dex3 > 1) {
$Reason = "URL Syntax"; //If message has 2+ "<a"
}
if ($dex4 > 0) {
$Reason = "PHP Syntax"; //If message has "<?", automatic ban
}
if ($dex5 > 0 || $dex6 > 0) {
$Reason = "spammer or bot"; //If message has "Nice site" message or the "Cool site" message
}
if ($dex7 > 0 && $dex1 > 0 && $dex3 > 0) {
$Reason = "spammer or bot"; //My newest addition, "Thanks" + "<a" + "http" = ban
}
if ($Reason != "Unknown") {
//Add to BAN table in SQL
die("Banned: $Reason");
}