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
Dan Kennedy once said that if you can't make money... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
More and more non-profit organizations are developing websites to help... Read More
When building a relationship, listening is more important than talking.A... Read More
Everywhere you look these days, people are telling you that... Read More
Recently, a friend asked "What's the deal with those DIY... Read More
A system development process can follow a number of standard... Read More
Q. Hey, Cathy: I'm just setting up a website. What... Read More
1. As the first step, "Hire a web designer."First create... Read More
Recently I was reviewing the keyword specific conversion rate data... Read More
A website is lifeline of internet home business. In order... Read More
Knowledge is power.And undoubtedly, it is the key to making... Read More
The first step in setting up an online business...Starting an... Read More
For years now I've been looking to start my own... Read More
The evolution of web development parallels the model of technology... Read More
People often come to me in a state of crisis... Read More
Directory Generator, a product from Armand Morin and Marc Quarles,... Read More
What is the point of having a website, you may... Read More
Your web site will be your window to the world.... Read More
I've heard several prominent web marketers mention in their classes... Read More
The Internet is a remarkable publishing medium. With just a... Read More
2 Golden Rules for an Engaging Website35% of visitors fail... Read More
When you take a look at the most visited sites... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
A lot of people these days are interested in getting... Read More
after renovation cleaning Highland Park ..As increasing numbers of people search for information on the... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
I talk with so many people who have small businesses... Read More
Many websites I come across don't have a single link... Read More
There have been many significant changes to the face of... Read More
1. Many people are not getting good or complete advice.... Read More
My life's greatest passion is a safari hobby. And what... Read More
D.zigns dzignerwebs The Basics Before starting on... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
Simply ensuring your website is accessible to screen reader users... Read More
After years of working with entrepreneurs who developed their first... Read More
Everyday thousands of new businesses make the leap and take... Read More
If you are like me you have wanted to build... Read More
Anyone who knows anything about web accessibility knows that images... Read More
It never ceases to amaze me how many people set-up... Read More
Recently, a friend asked "What's the deal with those DIY... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
Even though the Internet has been around for a long... Read More
Mini Websites are the most powerful and cost effective solution... Read More
Most interactive websites nowadays would require a user to log... Read More
There's been widespread speculation about the new legislation being introduced... Read More
In the big, wide online world there are millions of... Read More
Often time I've browsed sites and seen the same thing... Read More
You've put up a website to promote a product or... Read More
Thousands of people are now making a living online and... Read More
Web Development |