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
Your site is fast and getting traffic, but conversion rates... Read More
Before you start building your site, ask yourself "WHY?". Why... Read More
--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More
A system development process can follow a number of standard... Read More
You don't believe in astrology but you check your horoscope... Read More
Project Safekids provides webmasters a valuable tool which could save... Read More
1. As the first step, "Hire a web designer."First create... Read More
RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More
If you were asked to put a value on your... Read More
Through the explosive growth of the Web, companies have realized... Read More
The Internet is being used by local service business to... Read More
Creatively marketing your corporate site takes time in the set... Read More
Just like all things in life, the ways to run... Read More
We've all seen those messages on some websites warning not... Read More
Design and layout can make your communication come alive and... Read More
It's now easier than ever to take payments on the... Read More
There are many elements that are key to successful web... Read More
You want to give your site's visitors a way to... Read More
When visitors add your web site to their Favorites or... Read More
A company must earn and keep trust or sales don't... Read More
If you have your own business website and you are... Read More
Huge Mistake #1: Creating a Website with Flash -- Did... Read More
So you've decided to start an online work at home... Read More
Fantastico is a 3rd-party cPanel add-on and can be purchased... Read More
Although CSS layouts have been around for years, they haven't... Read More
shuttle from O'Hare Alexander ..Server Side Includes (SSI) with ASP People often... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
Wow, we`ve already taken a domain and chosen a web... Read More
Internet has opened a whole new world for web developers... Read More
Appealing to others is really important when you have a... Read More
Before you set up any scripts you will need some... Read More
QUESTION: Should I build and maintain my business Web... Read More
Creatively marketing your corporate site takes time in the set... Read More
From early days of www, the Internet sites that are... Read More
Optimal website design is the art of logical navigation.It will... Read More
One of the most useful features offered by some web... Read More
One of the biggest mistakes that most online retailers make... Read More
The first step in setting up an online business...Starting an... Read More
If you're an up and coming graphic/web designer just out... Read More
Why do some sites succeed while the vast majority of... Read More
Although designing a great web site is an important part... Read More
Is Your Web Site an Expense or an Investment?Why don't... Read More
There are many elements that are key to successful web... Read More
While most marketers are beginning to understand the critical importance... Read More
Through the explosive growth of the Web, companies have realized... Read More
Right after the thought, "I need a website," people usually... Read More
Every small business owner knows that they need a website,... Read More
Thinking about starting up a business? The web is the... Read More
Simply ensuring your website is accessible to screen reader users... Read More
The Internet car buyer is an elusive animal. Trying to... Read More
Web Development |