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
Every good Internet business understands the value of conversions versus... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
So you've decided to start an online work at home... Read More
In this example I have used the map of the... Read More
Q1.Why would I need a web site? A1.- Improve my... Read More
So you want to have a website. You have gone... Read More
A website is lifeline of internet home business. In order... Read More
With all of the factors involved in designing and building... Read More
They might not be wearing a mask and carrying a... Read More
Simply ensuring your website is accessible to screen reader users... Read More
So you have a good idea for a business and... Read More
QUESTION: Should I build and maintain my business Web... Read More
I can't think of any business alive today that couldn't... Read More
You've decided to create a website to market your products... Read More
Before you start building your site, ask yourself "WHY?". Why... Read More
One of the things that many people overlook when building... Read More
Writing for the web is totally different to writing for... Read More
Profiles are one of the best kept secrets around regarding... Read More
I still remember it very clear ... It was almost... Read More
Rosalind wants to share her inspirational poetry with a wider... Read More
If you are like me you have wanted to build... Read More
If you've been developing websites on Mars for the past... Read More
SiteSpinnerSiteSpinner is a user-friendly web site development tool that includes... Read More
The cost of setting up a web site is dirt... Read More
Below, I have listed 8 simple steps that you can... Read More
best cleaning company Highland Park ..Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More
If you ever want to create a state directory, article... Read More
While it may seem like a "quick and easy" task,... Read More
I've heard several prominent web marketers mention in their classes... Read More
"I don't sell anything online, I don't advertise online, in... Read More
A website is lifeline of internet home business. In order... Read More
An automated accessibility tool is a piece of software which... Read More
Why do some web sites reap huge benefits while others... Read More
What is the point of having a website, you may... Read More
In 1995 a new era of accessibility for disabled people... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
Does My Web Site Require A Web Database?If your web... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
The Disability Discrimination Act says that websites must be made... Read More
An Introduction to Server Side IncludesBeginner? That's OK!While much has... Read More
An additional benefit of website accessibility is an improved performance... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
When you publish a content site there are times when... Read More
People often come to me in a state of crisis... Read More
When people think about the Internet, they think about technology.... Read More
As increasing numbers of people search for information on the... Read More
Recently I was reviewing the keyword specific conversion rate data... Read More
Before you set up any scripts you will need some... Read More
Web Development |