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
When web content gets discussed on webmaster bulletin boards, the... Read More
Revenues are often lost because many business owners don't see... Read More
In the region where my company is located, South Bend,... Read More
Just like all things in life, the ways to run... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
It may seem like the publishing industry's equivalent of Beanie... Read More
Have you ever thought the secret behind the success of... Read More
So what do you do if need to get a... Read More
There's been widespread speculation about the new legislation being introduced... Read More
After having decided to start a business, the next thing... Read More
You want to give your site's visitors a way to... Read More
If you are looking for creating your online presence you... Read More
The growth in Internet usage around the world is astounding... Read More
Wow, we`ve already taken a domain and chosen a web... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
Is Your Web Site an Expense or an Investment?Why don't... Read More
Through the explosive growth of the Web, companies have realized... Read More
If you're looking for better web site ROI, chances are,... Read More
Is your website Really useful?I had a 'rep' in yesterday... Read More
One of the most useful features offered by some web... Read More
Setting up a website is the very first step of... Read More
When most people build a web site, they think one... Read More
Starting a business online is no longer as difficult as... Read More
We've all seen those messages on some websites warning not... Read More
Thinking about starting up a business? The web is the... Read More
bathroom cleaning service Mundelein ..Through the explosive growth of the Web, companies have realized... Read More
Failure, just like success, is measured differently by each and... Read More
After having decided to start a business, the next thing... Read More
Knowledge is power.And undoubtedly, it is the key to making... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
So your traffic is going through the roof yeah? It's... Read More
An automated accessibility tool is a piece of software which... Read More
Are you aware that 90% of the websites on the... Read More
The DDA (Disability Discrimination Act) states that service providers must... Read More
The Internet has opened a whole New World of opportunity... Read More
There are lots of HTML editors on the market, however,... Read More
While most marketers are beginning to understand the critical importance... Read More
Now that you have got your domain name registered, your... Read More
The art of turning website visitors into paying customers depends... Read More
With search engines putting a damper on direct reciprocal links,... Read More
So your prospect, Mary, is sitting at the computer reading... Read More
Think up a name and check if yourname.com is available.... Read More
In this day and age most businesses consider having their... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
There are millions and millions of websites on the Internet.... Read More
A simple website stats counter is not enough if you... Read More
When you consider the billions of individuals and companies on... Read More
I've heard several prominent web marketers mention in their classes... Read More
There are hundreds of millions of Web surfers today. Each... Read More
If you were asked to put a value on your... Read More
Web Development |