We've all seen those messages on some websites warning not to click a button more than once or negative consequences, like paying a bill twice, may result. Sometimes we can cause these problems by hitting the back or refresh buttons. In this article I will explain a methodology whereby a site can ensure each form is submitted only once, thereby demonstrating that such warnings are unnecessary and, depending on the nature of the problems caused, worth repairing immediately. Let's begin by taking a look at the process we are studying: Form Submission. As pedantic as it may seem, it will be worthwhile to detail each of the steps in this process:
Since the item which changes does not depend on the form being submitted (e.g. it doesn't matter if it's a newsletter registration form, customer signup form, payment form, etc.), the item is not something which already exists and therefore must be created, so let's create a form variable called submissionId and assume it has the 3 properties mentioned above. So far, so good -- or so it appears! The third "property" is that "we can tell [it] changed", but "changed" is not a property of a variable, so we need to look at this more closely. In order to tell something changed, we must have a reference point, an answer to the question "changed from what?" This is where a session variable will come into play. If we define a session variable, say $_SESSION['nextValidSubmission'] and treat it as a reference point, we will have all of the tools necessary to protect our visitors. The idea will be to keep the session variable updated with the last submissionId sent out and change the submissionId each time it is sent out to the user. Then, if they try to resubmit the data, they will be submitting an old submissionId which doesn't match nextValidSubmission and we will know not to re-process this data. Let's look at this in terms of the processes:
Webmaster of script reference - The *NEW* PHP Reference & Tutorial Site For Non-Programmers
script reference
What is web accessibility & why is it important?Web accessibility... Read More
Are bloated images slowing down your web site and causing... Read More
So you've decided to start an online work at home... Read More
Making money with your web site is the dream and... Read More
Fresh website content for your visitors can be of real... Read More
In 1995 a new era of accessibility for disabled people... Read More
We all start out the same. Some have budgets, some... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
So what do you do if need to get a... Read More
In about the Time it takes to Watch a Reality... Read More
Even though the Internet has been around for a long... Read More
This simple question can take on several different forms, but... Read More
If you are developing your website on a host that... Read More
Never has competition been so difficult in the Internet world.... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
The art of turning website visitors into paying customers depends... Read More
A website is like an information flow, with you as... Read More
So your traffic is going through the roof yeah? It's... Read More
Are you, like many other website owners, frustrated at the... Read More
First, using a lot of web graphics, flash, banners and... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
How popular is online shopping? And is there room for... Read More
A system development process can follow a number of standard... Read More
Recently, a friend asked "What's the deal with those DIY... Read More
When marketing your website, it's important to know which of... Read More
Antioch Chicago limousine service ..The Internet has opened a whole New World of opportunity... Read More
When we review the sites of potential clients, there are... Read More
1. SiteSpinner V2 - On Sale www.deprice.com/sitespinner.htmSiteSpinner is a user-friendly... Read More
Some left shoes are in isle 5, while the right... Read More
Functions and Subroutines in ASP If you read... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
Thinking about starting up a business? The web is the... Read More
The "robots" meta tag, when used properly, will tell the... Read More
Alternate medicine finds its own place in the hearts and... Read More
Many small businesses have the misconception that their business can... Read More
Does My Web Site Require A Web Database?If your web... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
I recently helped my mom to launch a website (www.mom2me.com)... Read More
Most interactive websites nowadays would require a user to log... Read More
Every good Internet business understands the value of conversions versus... Read More
Although there are significant differences among the various types of... Read More
Everyday thousands of new businesses make the leap and take... Read More
Never has competition been so difficult in the Internet world.... Read More
How can we add Word Rich Content to our Websites... Read More
When a user signs up at your website, you may... Read More
Server Side Includes (SSI) with ASP People often... Read More
Dan Kennedy once said that if you can't make money... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
One of the things that many people overlook when building... Read More
So you've decided to start an online work at home... Read More
Web Development |