Jump to content

Even after adding antifloor some people being able to post same stuff again.


$php_mysql$

Recommended Posts

friends whats wrong with this piece of code that one user on my site spams the same thing over and over tho i have added flood control for 6hours but he posts right after posting one. i have tested myself it works for me but why not for that user?

 


        if($_SESSION['last_session_request'] > time() - 21600){
    		        header("location: antiflood.php?post=wait");
    		        exit;
		}	
		$_SESSION['last_session_request'] = time();		

Link to comment
Share on other sites

No, I suppose (as most forums, chatboxes, or reply post do) you store a user_id to the post as well as the time posted.

 

<?php
$sql = "SELECT COUNT(id) FROM forum WHERE user_id = $current_user AND '00:00:30' > TIMEDIFF(NOW(),`timestamp_column`)"; //30 second control.
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result) > 0) {
exit(' You can only post 1 time per minute.');
}

Link to comment
Share on other sites

Without requiring users to be registered, you are kind of out of luck. You could use a cookie, but they can just delete it. You could use their IP, but they could just change it. You could require an email, but they can just use a different one. You could use a captcha, but they can be bypassed.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.