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
If you don't have a web site yet, are thinking... Read More
1. Many people are not getting good or complete advice.... Read More
Launching a new small business website is often a long... Read More
"If you build it, they will come"; is an age... Read More
Even though the Internet has been around for a long... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
When building a relationship, listening is more important than talking.A... Read More
Although there are significant differences among the various types of... Read More
Think up a name and check if yourname.com is available.... Read More
SummaryHere's the scoop on what you must know when designing... Read More
Right after the thought, "I need a website," people usually... Read More
When you take a look at the most visited sites... Read More
Most interactive websites nowadays would require a user to log... Read More
1) Word of Mouth The single most powerful form of... Read More
Through the explosive growth of the Web, companies have realized... Read More
If you are like me you have wanted to build... Read More
I'm a freelance programmer and somehow I managed to get... Read More
Have you ever wondered what challenges are faced by other... Read More
Affiliate programs are a great way to earn an income... Read More
While it may seem like a "quick and easy" task,... Read More
1) Data CaptureOne easy way to collect e-mail addresses and... Read More
In about the Time it takes to Watch a Reality... Read More
An automated accessibility tool is a piece of software which... Read More
It amazes me how many people try to build serious... Read More
Knowledge is power.And undoubtedly, it is the key to making... Read More
maide service in Buffalo Grove ..QUESTION: Should I build and maintain my business Web... Read More
Simply ensuring your website is accessible to screen reader users... Read More
What to do if you are an artist after you... Read More
You have permission to publish this article electronically, in print,... Read More
Writing for the web is totally different to writing for... Read More
Design and layout can make your communication come alive and... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
My life's greatest passion is a safari hobby. And what... Read More
You hear a great deal about the Internet these days... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
In the big, wide online world there are millions of... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
"Don't Sell the Steak, Sell the Sizzle."Have you heard of... Read More
I'm a freelance programmer and somehow I managed to get... Read More
Installment 1Developing State-enabled Applications With PHPWhen a user is browsing... Read More
It never ceases to amaze me how many people set-up... Read More
So you have a good idea for a business and... Read More
Making money with your web site is the dream and... Read More
When you consider the billions of individuals and companies on... Read More
Many executives and investors are skeptical that software products can... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
Absolutely everything stems from the purpose of your website -... Read More
If one more business owner tells me their website sucks... Read More
Optimal website design is the art of logical navigation.It will... Read More
Creatively marketing your corporate site takes time in the set... Read More
Web Development |