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
Conceptualize, Build and Publish a Web site - What's required... Read More
Q. Hey, Cathy: I'm just setting up a website. What... Read More
What you should do and know if you are an... Read More
Think up a name and check if yourname.com is available.... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
While creating a Web site may seem like... Read More
The Internet has opened a whole New World of opportunity... Read More
Whether you have your own business already, or are looking... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
Mini Websites are the most powerful and cost effective solution... Read More
Many millions of dollars are being wasted on promoting and... Read More
Dance is how you pamper your soul and satiate your... Read More
As a business you can't afford to ignore the Internet... Read More
A while ago one of my clients approached me and... Read More
One of the most important parts of establishing a new... Read More
The cost of setting up a web site is dirt... Read More
A website provides invaluable advantages for businesses who have one.7... Read More
I am just a learner who likes to delve in... Read More
1) A marketing necessityI still hear it said from time... Read More
The process of Web application development is critical to the... Read More
Building a website and getting it online is easy. Driving... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
You know exactly what your organisation does and what your... Read More
Just like all things in life, the ways to run... Read More
Right after the thought, "I need a website," people usually... Read More
Granger limo Chicago ..An interesting eCommerce success factor that isn't precisely overlooked, but... Read More
The cost of setting up a web site is dirt... Read More
When marketing your website, it's important to know which of... Read More
1. Many people are not getting good or complete advice.... Read More
1) Data CaptureOne easy way to collect e-mail addresses and... Read More
Running an effective website is a continuous process. I have... Read More
If you have some experience in web site design and... Read More
"If you build it, they will come"; is an age... Read More
I can't think of any business alive today that couldn't... Read More
Thinking about starting up a business? The web is the... Read More
When you take a look at the most visited sites... Read More
So you have a good idea for a business and... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
When building a relationship, listening is more important than talking.A... Read More
"What's in it for me?" you ask. "Why should I... Read More
The following is a list of patterns that many visitors... Read More
While it may seem like a "quick and easy" task,... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
"'Page Not Found' on this Server. Check the URL and... Read More
Analyzing traffic to a site is a key factor in... Read More
RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More
They might not be wearing a mask and carrying a... Read More
I talk with so many people who have small businesses... Read More
What to put your the website if you are an... Read More
Below, I have listed 8 simple steps that you can... Read More
Web Development |