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
Web templates by nature are created to aid and ease... Read More
So you have decided that you want to do freelance... Read More
A system development process can follow a number of standard... Read More
The art of turning website visitors into paying customers depends... Read More
"If you build it, they will come"; is an age... Read More
Go to any internet marketing forum you want these days... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
Many of site owners still don't realize all advantages of... Read More
Functions and Subroutines in ASP If you read... Read More
When most people build a web site, they think one... Read More
After planning the design and content of your website, it's... Read More
Here's something you may never have thought of before:If I... Read More
It's now easier than ever to take payments on the... Read More
Build it and they will come is not always true;... Read More
I am just a learner who likes to delve in... Read More
Affiliate programs are a great way to earn an income... Read More
You hear a great deal about the Internet these days... Read More
I'm a freelance programmer and somehow I managed to get... Read More
While most marketers are beginning to understand the critical importance... Read More
Now that you have got your domain name registered, your... Read More
If you don't have a web site yet, are thinking... Read More
Through the explosive growth of the Web, companies have realized... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
Every good Internet business understands the value of conversions versus... Read More
Profiles are one of the best kept secrets around regarding... Read More
weekly home cleaning Mundelein ..One of the best tools you have as a webmaster... Read More
Building a new website can be a lengthy task. From... Read More
Every good Internet business understands the value of conversions versus... Read More
Is your website Really useful?I had a 'rep' in yesterday... Read More
If one more business owner tells me their website sucks... Read More
It may come as some surprise to a traditionally off-line... Read More
Making maximum profit from your law firm website is important,... Read More
If you're an up and coming graphic/web designer just out... Read More
While studying online for IT investment opportunities, I found that... Read More
A lot has changed in the way sites are optimized... Read More
For years now I've been looking to start my own... Read More
Making a web site is easy. Making a good web... Read More
Everywhere you look these days, people are telling you that... Read More
Thinking about starting up a business? The web is the... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
An automated accessibility tool is a piece of software which... Read More
Does your website have a links/resources page?Do you exchange reciprocal... Read More
Your site is getting traffic, but conversion rates are horrible.... Read More
I had a client say something to me the other... Read More
Many millions of dollars are being wasted on promoting and... Read More
Build it and they will come is not always true;... Read More
A website is the most versatile and cost-effective marketing tool... Read More
People like to get immediate responses to requests. Autoresponders are... Read More
You have permission to publish this article electronically, in print,... Read More
Understanding and using web analytics.In recent years, website marketers were... Read More
Web Development |