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 popular search engine Google indexes over 8 billion websites.... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
Although CSS layouts have been around for years, they haven't... Read More
This simple question can take on several different forms, but... Read More
Recently I was reviewing the keyword specific conversion rate data... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
You work hard to build traffic to your web page.... Read More
Your business website is a critical aspect of being able... Read More
1. Splash pagesMost of the time splash pages are uncalled... Read More
Dan Kennedy once said that if you can't make money... Read More
Often time I've browsed sites and seen the same thing... Read More
Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
Losing website sales and traffic is sometimes simply a case... Read More
"Don't Sell the Steak, Sell the Sizzle."Have you heard of... Read More
Through the explosive growth of the Web, companies have realized... Read More
Any new website competing on the internet, needs to take... Read More
Writing for the web is totally different to writing for... Read More
Optimal website design is the art of logical navigation.It will... Read More
One of the best tools you have as a webmaster... Read More
Like wine cars get more attractive to collectors as years... Read More
So you want to take a look at a real... Read More
They might not be wearing a mask and carrying a... Read More
Go to any internet marketing forum you want these days... Read More
You've decided to create a website to market your products... Read More
This article was prompted by some customer support work I... Read More
Green Bay Hummer H2 SUV rentals ..Creatively marketing your corporate site takes time in the set... Read More
The Internet is being used by local service business to... Read More
Any new website competing on the internet, needs to take... Read More
"How do I improve web site sales figures?" The CEO... Read More
A lot of people these days are interested in getting... Read More
What is the most important part of your online business?Many... Read More
Dance is how you pamper your soul and satiate your... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
Creating and maintaining an effective presence on the Web has... Read More
If you ever want to create a state directory, article... Read More
People often come to me in a state of crisis... Read More
URL rewriting are major needs for your sites that produce... Read More
Are you, like many other website owners, frustrated at the... Read More
How many Web Sites did you stumble over telling you... Read More
See how you can create graphic effects on text with... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
You hear a great deal about the Internet these days... Read More
While creating a Web site may seem like... Read More
Profiles are one of the best kept secrets around regarding... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
A website is the most versatile and cost-effective marketing tool... Read More
One of the things that many people overlook when building... Read More
Anyone who knows anything about web accessibility knows that images... Read More
Before you start building your site, ask yourself "WHY?". Why... Read More
Web Development |