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
When people think about the Internet, they think about technology.... Read More
"I have a small business with just a couple of... Read More
While studying online for IT investment opportunities, I found that... Read More
The Internet car buyer is an elusive animal. Trying to... Read More
Although there are significant differences among the various types of... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
Here's something you may never have thought of before:If I... Read More
A professional online reputation is essential to the flourishing of... Read More
People often come to me in a state of crisis... Read More
What do you mean, you don't have a website for... Read More
A PHP Redirect automatically transfers a web user from one... Read More
The "robots" meta tag, when used properly, will tell the... Read More
Your web site will be your window to the world.... Read More
You have permission to publish this article electronically, in print,... Read More
Web templates by nature are created to aid and ease... Read More
Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
When you take a look at the most visited sites... Read More
There are hundreds of millions of Web surfers today. Each... Read More
I've heard several prominent web marketers mention in their classes... Read More
When marketing your website, it's important to know which of... Read More
SiteSpinnerSiteSpinner is a user-friendly web site development tool that includes... Read More
The growth in Internet usage around the world is astounding... Read More
Your site is fast and getting traffic, but conversion rates... Read More
In the region where my company is located, South Bend,... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
residential cleaning services Deerfield ..When I started my company in 2002, I knew I... Read More
It never ceases to amaze me how many people set-up... Read More
Never has competition been so difficult in the Internet world.... Read More
Knowledge is power.And undoubtedly, it is the key to making... Read More
When you publish a content site there are times when... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
"I don't sell anything online, I don't advertise online, in... Read More
How can we add Word Rich Content to our Websites... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
A company must earn and keep trust or sales don't... Read More
One of the most useful features offered by some web... Read More
The Disability Discrimination Act states that service providers must not... Read More
A lot has changed in the way sites are optimized... Read More
If you don't have a web site yet, are thinking... Read More
When you consider the billions of individuals and companies on... Read More
Are you, like many other website owners, frustrated at the... Read More
Installment 1Developing State-enabled Applications With PHPWhen a user is browsing... Read More
Whether you have your own business already, or are looking... Read More
There was a time not long ago when setting up... Read More
In 1995 a new era of accessibility for disabled people... Read More
I am just a learner who likes to delve in... Read More
Designing an E-commerce Web site is not as simple as... Read More
How do you decide on the content, products and or... Read More
Absolutely everything stems from the purpose of your website -... Read More
The needs of screen magnifier users are overlooked when implementing... Read More
Web Development |