i want a codeing that auo bans the user for spamming and sends a pm to the owner saying the user has been banned for spamming
auto ban script xhtml
Collapse
X
-
sounds silly to me, why not be proactive and stop spamming before it happens rather than banning someone after the damage has been done. Heres a few ideas:
1. Message timer: you can only send 1 message every 2 minutes (i think thats fair) . Example theory code, wont work on any specific source Something like this should go before the message is inserted (this way people can still write the message but not send it, i recommend adding a timer to the message creation page if their is a wait time so people know not to hit the send button until the timer has elapsed, you could use javascript to make it tick down for javascript enabled browsers.
Code:$time = time() - 120; //the 2 minute wait time $res=mysql_query("SELECT id FROM messages WHERE sent >= $time LIMIT 1"); if(mysql_num_rows($res) > 0) die("2 minute wait time in effect");
Code:$body = $_POST['body']; $time = time()-3600; $res = mysql_query("SELECT id FROM messages WHERE sent >= $time AND body LIKE '".$body."' LIMIT 1"); if(mysql_num_rows($res) > 0) die("feck off");
There are many things you can do to stop spamming before it happens, a ban for spamming script should be a last resort or after thought, since there is lag time between detection and message purging the damage could have already taken effect.
Comment
Comment