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
This is a growing concern amongst many business owners. Does... Read More
Many executives and investors are skeptical that software products can... Read More
We all start out the same. Some have budgets, some... Read More
The first thing you will have to deal building your... Read More
With search engines putting a damper on direct reciprocal links,... Read More
The needs of screen magnifier users are overlooked when implementing... Read More
Making money with your web site is the dream and... Read More
What to put your the website if you are an... Read More
"I have a small business with just a couple of... Read More
When you started reading this sentence you assumed lo acabar?a... Read More
If you don't have a web site yet, are thinking... Read More
An automated accessibility tool is a piece of software which... Read More
The internet has taken over our lives with a vengeance,... Read More
It may come as some surprise to a traditionally off-line... Read More
Are bloated images slowing down your web site and causing... Read More
What happened on your website yesterday? What about last week... Read More
When you consider the billions of individuals and companies on... Read More
If you're looking for better web site ROI, chances are,... Read More
Starting and maintaining a business is challenging enough without the... Read More
If you're fairly new to the Internet scene, you may... Read More
I recently helped my mom to launch a website (www.mom2me.com)... Read More
Even with the steady growth of the World Wide Web,... Read More
Every small business owner knows that they need a website,... Read More
In this day and age most businesses consider having their... Read More
When web content gets discussed on webmaster bulletin boards, the... Read More
green cleaning service Lincolnshire ..Writing for the web is totally different to writing for... Read More
There was a time not long ago when setting up... Read More
The growth in Internet usage around the world is astounding... Read More
Web accessibility has so many benefits that I really do... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
Simply ensuring your website is accessible to screen reader users... Read More
Many websites I come across don't have a single link... Read More
Many millions of dollars are being wasted on promoting and... Read More
One of the most important parts of establishing a new... Read More
Designing and creating your own website does not have to... Read More
A lot of people these days are interested in getting... Read More
We've all seen those messages on some websites warning not... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
If you like the Internet and surfing through the billions... Read More
Just starting out, you can start with a simple informational... Read More
Profiles are one of the best kept secrets around regarding... Read More
So you have decided that you want to do freelance... Read More
A website provides invaluable advantages for businesses who have one.7... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
When we review the sites of potential clients, there are... Read More
More and more businesses are recognizing the importance of content... Read More
If you have your own business website and you are... Read More
Before you set up any scripts you will need some... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
What is SQL? SQL stands for Structured Query Language and... Read More
Web Development |