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
So you have a good idea for a business and... Read More
Every small business owner knows that they need a website,... Read More
Is Your Web Site an Expense or an Investment?Why don't... Read More
Even with the steady growth of the World Wide Web,... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
D.zigns dzignerwebs The Basics Before starting on... Read More
A lot of people these days are interested in getting... Read More
In about the Time it takes to Watch a Reality... Read More
The "robots" meta tag, when used properly, will tell the... Read More
Making maximum profit from your law firm website is important,... Read More
Many millions of dollars are being wasted on promoting and... Read More
Right after the thought, "I need a website," people usually... Read More
So your traffic is going through the roof yeah? It's... Read More
"What's in it for me?" you ask. "Why should I... Read More
Simply ensuring your website is accessible to screen reader users... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
There are several reverse bid freelance sites out there. Beyond... Read More
The growth in Internet usage around the world is astounding... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
When used to describe a web site, the term "sticky"... Read More
Creatively marketing your corporate site takes time in the set... Read More
I'm a freelance programmer and somehow I managed to get... Read More
The Internet has opened a whole New World of opportunity... Read More
People like to get immediate responses to requests. Autoresponders are... Read More
URL rewriting are major needs for your sites that produce... Read More
cleaning lady near Deerfield ..Creating a content management system either from scratch,... Read More
Do you need a web site? Are you considering getting... 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
A lot has changed in the way sites are optimized... Read More
Rosalind wants to share her inspirational poetry with a wider... Read More
Is your website Really useful?I had a 'rep' in yesterday... Read More
Research reveals three important facts:1) The Internet is one of... Read More
--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More
Absolutely everything stems from the purpose of your website -... Read More
A website provides invaluable advantages for businesses who have one.7... Read More
"I am a writer, not a business-person. I don't want... Read More
In this day and age most businesses consider having their... Read More
There have been many significant changes to the face of... Read More
"How do I improve web site sales figures?" The CEO... Read More
Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
The cost of setting up a web site is dirt... Read More
While it may seem like a "quick and easy" task,... Read More
Making a web site is easy. Making a good web... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
Setting up a website is the very first step of... Read More
The definition of the phrase "Content Management" depends on what... Read More
With all of the factors involved in designing and building... Read More
While studying online for IT investment opportunities, I found that... Read More
Web Development |