There's two things I wish to achieve;
-Prevent a `message` entry that's the same as the previous.
-Prevent a user's `IP` from posting more than one entry per 30 seconds (using the date column somehow?).
For the first part, my code looks something like:
Code: Select all
$last_post = mysql_query("SELECT MAX(post), message FROM `users");// "post" is a auto_increment column that numbers the posts
$message = htmlspecialchars($messagea); //variable messagea previously defined in code as a filtered $_POST
IF ( $message == $last_post ) {
die(' Duplicate entrys! ');
}
ELSE {
execute code, ect
}Oh, and I can't set the column `message` as UNIQUE or anything, because it's far too large.
And the second part, I really don't know where to begin. Any ideas? :\