May 3, 201016 yr Hey guys i was wondering whats a simple way to creating flood control for a form thanks in advance
May 3, 201016 yr start a session, log the current time to the session and check if the current time less the logged time stored in the session is a certain number of seconds. Something like <?php session_start(); if(isset($_SESSION['lastpost'])) { if(time() - $_SESSION['lastpost'] < 300) { echo 'Submissions only allowed every 5 minutes'; }else{ // RUN YOUR SUBMISSION CODE HERE } } $_SESSION['lastpost'] = time(); ?>
May 3, 201016 yr Author start a session, log the current time to the session and check if the current time less the logged time stored in the session is a certain number of seconds. Something like <?php session_start(); if(isset($_SESSION['lastpost'])) { if(time() - $_SESSION['lastpost'] < 300) { echo 'Submissions only allowed every 5 minutes'; }else{ // RUN YOUR SUBMISSION CODE HERE } } $_SESSION['lastpost'] = time(); ?> Ok thanks that works perfect
May 5, 201016 yr hmm, i know you said simple, but that's not going to work really... If i turn off cookies or delete that cookie every time i can easily flood your forums :< Just dump their IP address into the database, will be more effective. Or combine both..
May 5, 201016 yr Combine Sessions, with IP Dumping and a Captcha form, then only the people who want to post will post, it wont deter people either because the session is something they will never see along with the IP address unless they are spamming. Then the Captcha just keeps them on their toes and spammers wont want to bother with that. Good luck anyway, let us know what you find most effective
May 5, 201016 yr Combine Sessions, with IP Dumping and a Captcha form, then only the people who want to post will post, it wont deter people either because the session is something they will never see along with the IP address unless they are spamming. Then the Captcha just keeps them on their toes and spammers wont want to bother with that. Good luck anyway, let us know what you find most effective creating flood control for a form He didn't ask for spam control, he asked for flood control.
Create an account or sign in to comment