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
Although there are significant differences among the various types of... Read More
Most web sites are more like stage sets than real... Read More
Wow, we`ve already taken a domain and chosen a web... Read More
If your company own one or more stores, you might... Read More
Are you, like many other website owners, frustrated at the... Read More
One of the best tools you have as a webmaster... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
There was a time not long ago when setting up... Read More
A website provides invaluable advantages for businesses who have one.7... Read More
Most interactive websites nowadays would require a user to log... Read More
This article was prompted by some customer support work I... Read More
The Disability Discrimination Act states that service providers must not... Read More
Spend time planning your Web site. Before you design a... Read More
My life's greatest passion is a safari hobby. And what... Read More
How popular is online shopping? And is there room for... Read More
When visitors add your web site to their Favorites or... Read More
I still remember it very clear ... It was almost... Read More
Three way linking and concerns.For many years SEO experts were... Read More
With more and more countries around the world passing laws... Read More
So you want to take a look at a real... Read More
When a user signs up at your website, you may... Read More
The cost of setting up a web site is dirt... Read More
Everywhere you look these days, people are telling you that... Read More
There are many different traffic analysis tools, ranging from simple... Read More
Internet has opened a whole new world for web developers... Read More
express cleaning service Des Plaines ..This article was prompted by some customer support work I... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
1. Many people are not getting good or complete advice.... Read More
I recently helped my mom to launch a website (www.mom2me.com)... Read More
Part of the success of most home-based businesses is their... Read More
My life's greatest passion is a safari hobby. And what... Read More
When you purchase a new item from a Yahoo! Store,... Read More
Research reveals three important facts:1) The Internet is one of... Read More
I recently received an unsolicited e-mail from some company offering... Read More
Running an effective website is a continuous process. I have... Read More
Have you ever thought the secret behind the success of... Read More
There's been widespread speculation about the new legislation being introduced... Read More
There are hundreds of millions of Web surfers today. Each... Read More
What is the point of having a website, you may... Read More
Failure, just like success, is measured differently by each and... Read More
A company must earn and keep trust or sales don't... Read More
Now that you have got your domain name registered, your... Read More
The first step in setting up an online business...Starting an... Read More
A common dilemma most small and medium businesses face when... Read More
If you're fairly new to the Internet scene, you may... Read More
The first thing you will have to deal building your... Read More
"If you build it, they will come"; is an age... Read More
In this example I have used the map of the... Read More
Recently I was reviewing the keyword specific conversion rate data... Read More
Dan Kennedy once said that if you can't make money... Read More
Web Development |