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
Building a website and getting it online is easy. Driving... Read More
Part of the success of most home-based businesses is their... Read More
Website, website, website, everyone says you need one. But do... Read More
Your site is fast and getting traffic, but conversion rates... Read More
Go to any internet marketing forum you want these days... Read More
Web templates by nature are created to aid and ease... Read More
Absolutely everything stems from the purpose of your website -... Read More
When people think about the Internet, they think about technology.... Read More
SiteSpinnerSiteSpinner is a user-friendly web site development tool that includes... Read More
Rosalind wants to share her inspirational poetry with a wider... Read More
You've decided to create a website to market your products... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
Research reveals three important facts:1) The Internet is one of... Read More
Your site is getting traffic, but conversion rates are horrible.... Read More
Designing and creating your own website does not have to... Read More
With more and more countries around the world passing laws... Read More
1) Data CaptureOne easy way to collect e-mail addresses and... Read More
When we review the sites of potential clients, there are... Read More
Everyday thousands of new businesses make the leap and take... Read More
One of the biggest mistakes that most online retailers make... Read More
"If you build it, they will come"; is an age... Read More
URL rewriting are major needs for your sites that produce... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
Every business needs to know how it is doing. That's... Read More
cleaning lady near Lincolnshire ..Here's something you may never have thought of before:If I... Read More
Webmasters deal with a myriad of complex design challenges every... Read More
Building a new website can be a lengthy task. From... Read More
Visitors to your site come looking for information or solutions... Read More
In about the Time it takes to Watch a Reality... Read More
Is your website Really useful?I had a 'rep' in yesterday... Read More
As a business you can't afford to ignore the Internet... Read More
Launching a new small business website is often a long... Read More
If you're an up and coming graphic/web designer just out... Read More
Every business needs to know how it is doing. That's... Read More
If your company own one or more stores, you might... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
So your prospect, Mary, is sitting at the computer reading... Read More
Thousands of people are now making a living online and... Read More
The DDA (Disability Discrimination Act) states that service providers must... Read More
A system development process can follow a number of standard... Read More
You've just finished congratulating your marketing team. After six months... Read More
When a user signs up at your website, you may... Read More
If you're looking for better web site ROI, chances are,... Read More
1. Choose a big enough font size. A size 12... Read More
Directory Generator, a product from Armand Morin and Marc Quarles,... Read More
It may come as some surprise to a traditionally off-line... Read More
This is a growing concern amongst many business owners. Does... Read More
You've put up a website to promote a product or... Read More
No matter what browser you may want to use, you... Read More
Web Development |