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
You've put up a website to promote a product or... Read More
A system development process can follow a number of standard... Read More
If you have your own business website and you are... Read More
If you are developing your website on a host that... Read More
One of the most useful features offered by some web... Read More
Every business needs to know how it is doing. That's... Read More
1) Data CaptureOne easy way to collect e-mail addresses and... Read More
Anyone who knows anything about web accessibility knows that images... Read More
The internet is a sea of knowledge. Getting your information... Read More
Many executives and investors are skeptical that software products can... Read More
Understanding and using web analytics.In recent years, website marketers were... Read More
The Internet is being used by local service business to... Read More
Think up a name and check if yourname.com is available.... Read More
After deciding what kind of internet business you want to... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
When used to describe a web site, the term "sticky"... Read More
If you're anything like most small business owners, you probably... Read More
So you want to have a website. You have gone... Read More
Thousands of people are now making a living online and... Read More
After years of working with entrepreneurs who developed their first... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
Creating a content management system either from scratch,... Read More
The DDA (Disability Discrimination Act) states that service providers must... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
I still remember it very clear ... It was almost... Read More
full-service cleaning Mundelein ..When visitors add your web site to their Favorites or... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
Making maximum profit from your law firm website is important,... Read More
Three way linking and concerns.For many years SEO experts were... Read More
Design and layout can make your communication come alive and... Read More
When you purchase a new item from a Yahoo! Store,... Read More
Just starting out, you can start with a simple informational... Read More
1. Address your targeted audience on your business site. Example:... Read More
Launching a new small business website is often a long... Read More
Q1.Why would I need a web site? A1.- Improve my... Read More
I am just a learner who likes to delve in... Read More
What is web accessibility & why is it important?Web accessibility... Read More
Rosalind wants to share her inspirational poetry with a wider... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
Research reveals three important facts:1) The Internet is one of... Read More
If you are like me you have wanted to build... Read More
You've just finished congratulating your marketing team. After six months... Read More
Q. Hey, Cathy: I'm just setting up a website. What... Read More
That's right. Your method, behavior and strategy you are now... Read More
The Disability Discrimination Act says that websites must be made... Read More
Web sites are not just places to sell things; they... Read More
As a business you can't afford to ignore the Internet... Read More
Web templates by nature are created to aid and ease... Read More
No matter what browser you may want to use, you... Read More
Selecting the Perfect Domain NameThe first issue I have with... Read More
Web Development |