Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Whats an simple method to creating form flood control?

Featured Replies

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();
?>

  • 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 :)

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.. :)

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 :)

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.