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
A professional online reputation is essential to the flourishing of... Read More
More and more non-profit organizations are developing websites to help... Read More
Every business needs to know how it is doing. That's... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
What you should do and know if you are an... Read More
The Internet car buyer is an elusive animal. Trying to... Read More
Many executives and investors are skeptical that software products can... Read More
When marketing your website, it's important to know which of... Read More
One of the most useful features offered by some web... Read More
It's now easier than ever to take payments on the... Read More
Have you ever thought the secret behind the success of... Read More
It never ceases to amaze me how many people set-up... Read More
Most people know they need a website in order to... Read More
We've all seen those messages on some websites warning not... Read More
It may come as some surprise to a traditionally off-line... Read More
Psychology is a long word which everyone thinks, "no, that's... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
Making a web site is easy. Making a good web... Read More
If you're fairly new to the Internet scene, you may... Read More
Below, I have listed 8 simple steps that you can... Read More
Looks like every client wants a Flash site these days... Read More
"'Page Not Found' on this Server. Check the URL and... Read More
Do you make your website just to entertain yourself or... Read More
How popular is online shopping? And is there room for... Read More
In the late 1990's three San Francisco based web developers... Read More
cleaning team near Buffalo Grove ...#5 User Satisfaction: Learn what your visitors and site users... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
So you have decided that you want to do freelance... Read More
SummaryHere's the scoop on what you must know when designing... Read More
There is an ongoing debate about web copy. Some say... Read More
A website is like an information flow, with you as... Read More
In my previous life.....Actually, my previous JOB life, I was... Read More
If you haven't made the sales and built your clients... Read More
Internet has opened a whole new world for web developers... Read More
A website lets you put your products in front of... Read More
Your business website is a critical aspect of being able... Read More
Analyzing traffic to a site is a key factor in... Read More
Spend time planning your Web site. Before you design a... Read More
The DDA (Disability Discrimination Act) states that service providers must... Read More
Your content is what gets you in search engines, speaks... Read More
Making maximum profit from your law firm website is important,... Read More
If you are developing your website on a host that... Read More
If you're fairly new to the Internet scene, you may... Read More
The big thing these days is your ability to capture... Read More
Functions and Subroutines in ASP If you read... Read More
Fresh website content for your visitors can be of real... Read More
Installment 1Developing State-enabled Applications With PHPWhen a user is browsing... Read More
What is CSS?CSS is a simple file which controls the... Read More
You've just finished congratulating your marketing team. After six months... Read More
Optimize your time. How much time each day must you... Read More
Web Development |