Managed to get this working!
function checkTime(){
$livetime = date('H:i:s', time() - 5);
$name = $_SESSION['chat-username'];
$q = mysql_query("SELECT * FROM chat WHERE name = '$name' AND time >= '$livetime'");
$check = mysql_num_rows($q);
if($check >= 3){
echo "Woah! Slow down there..."...
This isn't really what I was looking for.
If I take another approach at trying to explain.
Like on Habbo, you can flood.
When you type so many messages at one given time, you have to wait 30 or 20 seconds to type another message.
Hello,
I've been trying to create a way for PHP to check if a user is spamming comments.
For instance, the user keeps constantly spamming the same letter or spamming a link, the user will be automatically banned.
Let's say User A sends 5 messages within the space of 3 seconds.
They will be...
-- UPDATES --
Added new download link to original post.
Added auto URL's (URL changes to <a href="URL">URL</a>)
Added an option to register to reserve your username or sign in as a guest
Added chat box commands (\ban and \unban so far)
Next to come:
Admin sticky note
Ability to mute users...
I'm gonna add something which let's users either login / register or use it as a guest.
At which point if they're a guest, their name will be something like GUEST-{Random}.
Probably also add something to let people know who's online and away.
When you're writing a sentence and you include a few things, when you're coming to the end of the list and the time comes for you to use the word "and", do you stick a comma in front of it?
I see people do it all the time.
The first time I seen somebody do it I was like... wtf?
Today in...
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key = '6598' WHERE username = 'admin'' at line 1
The query worked before I implemented the key.