Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Prevent duplicate form submits
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Prevent duplicate form submits

 Post Reply Post Reply
Author
dfrancis View Drop Down
Senior Member
Senior Member


Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
Post Options Post Options   Thanks (0) Thanks(0)   Quote dfrancis Quote  Post ReplyReply Direct Link To This Post Topic: Prevent duplicate form submits
    Posted: 01 January 2007 at 11:37pm
Hi guys,
 
What is your favorite way of preventing duplicate submits on your forms?
 
Because I do work for Governmental/Political websites, I'm looking for a method that does not "require" JavaScript or Sessions to be passed.
 
I'm really interested in how you all have addressed this issue.
 
Thanks.
Back to Top
Brolin99 View Drop Down
Groupie
Groupie
Avatar

Joined: 03 May 2003
Location: New Zealand
Status: Offline
Points: 58
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brolin99 Quote  Post ReplyReply Direct Link To This Post Posted: 04 January 2007 at 2:18am
Hi there,
 
I had this problem a while back but found a way around it - although it depends on how you're using the form.
 
I had a User ID for each person inputing the data, and I created an ID for each form. Then, when the data got put into the database it would check to make sure that the user hadn't already filled the form out (obviously, on the first input I recorded the User ID and Form ID) - hope that helps.
 
Cheers
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 07 January 2007 at 4:48pm
I deal with this the same way, I always check against a unique field in the database to see if it is already there.
 
If what you are asking is to prevent the same user sending more than once, and no session use, then store his IP and datetime of submission, check against this IP every time the form is submited, use datetime to allow him submit again in x hous/days whatever, also note that the IPs are not always given fixed to end users and someone on a dynamic assignment will be albe to submit again if he disconnects and reconnects getting a new IP.
 
Better than all this is to have user registration/login, this way you always know what a particular user can/cannot do.
Back to Top
snapey View Drop Down
Newbie
Newbie


Joined: 28 July 2002
Location: United Kingdom
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote snapey Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2007 at 2:02am
The problem with IP tracking is that from most organisations, all the users will appear on the same IP. If its likely that multiple people from one organisation will want to contribute then you can't use the IP.
Back to Top
dfrancis View Drop Down
Senior Member
Senior Member


Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
Post Options Post Options   Thanks (0) Thanks(0)   Quote dfrancis Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2007 at 2:20am

Thanks for the ideas folks.

You're right about the IP issue. I've had as many as 100 users with the same IP on my site at the same time.
 
I was looking for a fool proof way to prevent duplicates on a political website where cookies/sessions and javascript are not to be used.
 
The simplest though not fool proof way I found was a simple redirect on processing.
 
I had an email form and simply used server side validation and then if it the form was good, process the form and then redirected to another page thus preventing the refresh issue. Sure, they could use the back button and submit again but I was only trying to avoid the inadvertent double post.
 
Thanks again.
Back to Top
snapey View Drop Down
Newbie
Newbie


Joined: 28 July 2002
Location: United Kingdom
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote snapey Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2007 at 6:56pm

Rather than store a 'cookie' on the visitors machine, just use a session variable. Set a flag if the form is submitted correctly, and then ignore if its already set. At least this way the visitor has to completely close the browser, revisit the site and refill the entire form.

I know session variables need 'cookies' to save the state but these are temporary only and are so widely needed I can't believe they are blocked in many circumstances.
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.