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
There are many different traffic analysis tools, ranging from simple... Read More
I'm a freelance programmer and somehow I managed to get... Read More
In this day and age most businesses consider having their... Read More
Like most average persons, I wanted some extra money to... Read More
I recently helped my mom to launch a website (www.mom2me.com)... Read More
Did you know that hosting companies overcrowd their servers despite... Read More
Like any area of business your website needs some effort... Read More
If you are living in a country that its native... Read More
The first thing you will have to deal building your... Read More
Thinking about starting up a business? The web is the... Read More
The definition of the phrase "Content Management" depends on what... Read More
The first thing my business consultant (read brother-in-law) asked me,... Read More
If one more business owner tells me their website sucks... Read More
Through the explosive growth of the Web, companies have realized... Read More
Are bloated images slowing down your web site and causing... Read More
More and more non-profit organizations are developing websites to help... Read More
An automated accessibility tool is a piece of software which... Read More
Developing a website with content that entices visitors to return... Read More
Research reveals three important facts:1) The Internet is one of... Read More
You have permission to publish this article electronically, in print,... Read More
It may seem like the publishing industry's equivalent of Beanie... Read More
A website provides invaluable advantages for businesses who have one.7... Read More
When people think about the Internet, they think about technology.... Read More
1) Data CaptureOne easy way to collect e-mail addresses and... Read More
A lot has changed in the way sites are optimized... Read More
express cleaning service Arlington Heights ..1. Be clear on your purpose.Building a website can be... Read More
Although there are significant differences among the various types of... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
Server Side Includes (SSI) with ASP People often... Read More
For years now I've been looking to start my own... Read More
Your website conversion rate should concern you. This simply refers... Read More
A PHP Redirect automatically transfers a web user from one... Read More
Your web site will be your window to the world.... Read More
With all of the factors involved in designing and building... Read More
The art of turning website visitors into paying customers depends... Read More
How many Web Sites did you stumble over telling you... Read More
A lot has changed in the way sites are optimized... Read More
With the New Year upon us yet again, it's time... Read More
Visitors to your site come looking for information or solutions... Read More
The Disability Discrimination Act states that service providers must not... Read More
RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More
If you have some experience in web site design and... Read More
Looks like every client wants a Flash site these days... Read More
Web sites are an Ongoing Part of Business.All too many... Read More
1. The first page appears quickly.It's a good way to... Read More
Dance is how you pamper your soul and satiate your... Read More
2 Golden Rules for an Engaging Website35% of visitors fail... Read More
Affiliate programs are a great way to earn an income... Read More
If one more business owner tells me their website sucks... Read More
Most web sites are more like stage sets than real... Read More
Web Development |