Solved

Getting multiple transaction postings

Posted on 1998-05-14
3
163 Views
Last Modified: 2013-12-25
Processing a cgi form in PERL, I am finding duplications (2x & 3x)  of the same record
appearing in the database. Believe the user holds the key down too long or perhaps
presses the submit key multiple times. How can I prevent these multiple transactions?
I'm a novice in PERL & do not know the C language equivalent to flushall(); could that
be the problem?
0
Comment
Question by:lshaffer
3 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 70 total points
Comment Utility
I don't think you can prevent it completely. What happens is when a user clicks on submit, the form data are send to your server, which then calls your perlscript. The sending takes time, depending on the speed of the connection and the amount of data send.

Then the script starts processing the data, which also takes some time, and when it is finished it sends the respons to the user.

Depending on how much data there is in the form, this can take a while, and the user will keep on seeing the form. Being impatient he might hit the submit button again, and send the data again.

One option to speed up the respons to the user is to send a first respons at the start of the perlscript, so before processing the data. But this might not be enough to prevent the user to get impatient.

So there is probably nothing left to do but make it easy to remove double transactions from the database.

If you use other, client side ways to make the form disappear when the user submits the form (for example using javascript) you  might miss some of the forms submitted as the data are lost in cyberspace.










0
 
LVL 6

Expert Comment

by:alamo
Comment Utility
Another possibility is that your form is using the GET method rather than the POST method to submit its data. A GET form will be resubmitted with no warning to the user when it is accessed via a bookmark, reloaded, or even sometimes by pressing the BACK button. A POST form will warn the user before resubmitting. The user could still resubmit it if they want, but that would be rare- resubmissions as you describe are usually accidental.
0
 

Author Comment

by:lshaffer
Comment Utility
This may be a workable solution. Time will tell. Thanks
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now