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
First, using a lot of web graphics, flash, banners and... Read More
Launching a new small business website is often a long... Read More
A company must earn and keep trust or sales don't... Read More
If you don't have a web site yet, are thinking... Read More
Just starting out, you can start with a simple informational... Read More
Making money with your web site is the dream and... Read More
While it may seem like a "quick and easy" task,... Read More
A professional online reputation is essential to the flourishing of... Read More
Profiles are one of the best kept secrets around regarding... Read More
How popular is online shopping? And is there room for... Read More
Many millions of dollars are being wasted on promoting and... Read More
How can we add Word Rich Content to our Websites... Read More
Like most average persons, I wanted some extra money to... Read More
I am just a learner who likes to delve in... Read More
Do you need a web site? Are you considering getting... Read More
One of the most useful features offered by some web... Read More
If you are living in a country that its native... Read More
If you have some experience in web site design and... Read More
One of the things that Internet excels is disseminating information... Read More
There are hundreds of millions of Web surfers today. Each... Read More
Fantastico is a 3rd-party cPanel add-on and can be purchased... Read More
Project Safekids provides webmasters a valuable tool which could save... Read More
Appealing to others is really important when you have a... Read More
So you've decided to start an online work at home... Read More
The internet has taken over our lives with a vengeance,... Read More
O'Hare Chicago prom limo ..Knowledge is power.And undoubtedly, it is the key to making... Read More
Functions and Subroutines in ASP If you read... Read More
No matter what browser you may want to use, you... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
Appealing to others is really important when you have a... Read More
If you don't have a web site yet, are thinking... Read More
--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
Web templates by nature are created to aid and ease... Read More
If one more business owner tells me their website sucks... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
Huge Mistake #1: Creating a Website with Flash -- Did... Read More
With more and more countries around the world passing laws... Read More
1. Address your targeted audience on your business site. Example:... Read More
How can we add Word Rich Content to our Websites... Read More
There is an ongoing debate about web copy. Some say... Read More
More and more businesses are recognizing the importance of content... Read More
After years of working with entrepreneurs who developed their first... Read More
When you publish a content site there are times when... Read More
Before you set up any scripts you will need some... Read More
Alternate medicine finds its own place in the hearts and... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
There are many different traffic analysis tools, ranging from simple... Read More
Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
Web Development |