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
"'Page Not Found' on this Server. Check the URL and... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
If you're fairly new to the Internet scene, you may... Read More
Are you, like many other website owners, frustrated at the... Read More
More and more businesses are recognizing the importance of content... Read More
As a business you can't afford to ignore the Internet... Read More
One of my most salient memories from when I sold... Read More
Thousands of people are now making a living online and... Read More
One of the things that many people overlook when building... Read More
A simple website stats counter is not enough if you... Read More
1. Be clear on your purpose.Building a website can be... Read More
Everywhere you look these days, people are telling you that... Read More
In about the Time it takes to Watch a Reality... Read More
What to do if you are an artist after you... Read More
If you are living in a country that its native... Read More
With the New Year upon us yet again, it's time... Read More
Looks like every client wants a Flash site these days... Read More
The internet is a sea of knowledge. Getting your information... Read More
When a user signs up at your website, you may... Read More
A website provides invaluable advantages for businesses who have one.7... Read More
In this day and age most businesses consider having their... Read More
Thinking about starting up a business? The web is the... Read More
1. Choose a big enough font size. A size 12... Read More
The Disability Discrimination Act says that websites must be made... Read More
bathroom cleaning service Lake Forest ..What is CSS?CSS is a simple file which controls the... Read More
I'm a freelance programmer and somehow I managed to get... Read More
When we review the sites of potential clients, there are... Read More
1) Data CaptureOne easy way to collect e-mail addresses and... Read More
If you were asked to put a value on your... Read More
Part of the success of most home-based businesses is their... Read More
Writing for the web is totally different to writing for... Read More
There's been widespread speculation about the new legislation being introduced... Read More
Did you know that hosting companies overcrowd their servers despite... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
There's been widespread speculation about the new legislation being introduced... Read More
That's right. Your method, behavior and strategy you are now... Read More
You've decided to create a website to market your products... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
Making maximum profit from your law firm website is important,... Read More
"I am a writer, not a business-person. I don't want... Read More
So you have a good idea for a business and... Read More
Below, I have listed 8 simple steps that you can... Read More
There are several reverse bid freelance sites out there. Beyond... Read More
I talk with so many people who have small businesses... Read More
Affiliate programs are a great way to earn an income... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
There is an ongoing debate about web copy. Some say... Read More
Think up a name and check if yourname.com is available.... Read More
An Introduction to Server Side IncludesBeginner? That's OK!While much has... Read More
Web Development |