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
The first thing my business consultant (read brother-in-law) asked me,... Read More
Developing a website with content that entices visitors to return... Read More
1. SiteSpinner V2 - On Sale www.deprice.com/sitespinner.htmSiteSpinner is a user-friendly... Read More
In this example I have used the map of the... Read More
If you were asked to put a value on your... Read More
Go to any internet marketing forum you want these days... Read More
Setting up a website is the very first step of... Read More
Recently I was reviewing the keyword specific conversion rate data... Read More
You've just finished congratulating your marketing team. After six months... Read More
It amazes me how many people try to build serious... Read More
I recently received an unsolicited e-mail from some company offering... Read More
Just like all things in life, the ways to run... Read More
Alternate medicine finds its own place in the hearts and... Read More
What is the most important part of your online business?Many... Read More
When used to describe a web site, the term "sticky"... Read More
80% of your Web site is Maintenance!Once your Web site... Read More
"Don't Sell the Steak, Sell the Sizzle."Have you heard of... Read More
A lot of people these days are interested in getting... Read More
Is your website Really useful?I had a 'rep' in yesterday... Read More
Many executives and investors are skeptical that software products can... Read More
1) Word of Mouth The single most powerful form of... Read More
There are hundreds of millions of Web surfers today. Each... Read More
There's been widespread speculation about the new legislation being introduced... Read More
When you purchase a new item from a Yahoo! Store,... Read More
You have permission to publish this article electronically, in print,... Read More
expert residential cleaners Park Ridge ...You've just finished congratulating your marketing team. After six months... Read More
Project Safekids provides webmasters a valuable tool which could save... Read More
Many web developers today are starting to KISS their website,... Read More
I've heard several prominent web marketers mention in their classes... Read More
If you're an up and coming graphic/web designer just out... Read More
As a business you can't afford to ignore the Internet... Read More
What happened on your website yesterday? What about last week... Read More
URL rewriting are major needs for your sites that produce... Read More
1) Word of Mouth The single most powerful form of... Read More
Affiliate programs are a great way to earn an income... Read More
Many small businesses have the misconception that their business can... Read More
Better Web Site ROIHow to increase your business profitability by... Read More
We all start out the same. Some have budgets, some... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
You hear a great deal about the Internet these days... Read More
There are hundreds of millions of Web surfers today. Each... Read More
With the New Year upon us yet again, it's time... Read More
In about the Time it takes to Watch a Reality... Read More
How do you decide on the content, products and or... Read More
So you want to take a look at a real... Read More
Web templates by nature are created to aid and ease... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
When you purchase a new item from a Yahoo! Store,... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
What you should do and know if you are an... Read More
Web Development |