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
We are clearly well past the innocent "golden age" of... Read More
A lot of people these days are interested in getting... Read More
You've just finished congratulating your marketing team. After six months... Read More
No matter the size of your business, having a web... Read More
If you're looking for better web site ROI, chances are,... Read More
Designing an E-commerce Web site is not as simple as... Read More
Losing website sales and traffic is sometimes simply a case... Read More
Are bloated images slowing down your web site and causing... Read More
Website, website, website, everyone says you need one. But do... Read More
Most web sites are more like stage sets than real... Read More
That's right. Your method, behavior and strategy you are now... Read More
You have seen those web pages where they have the... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
A website is like an information flow, with you as... Read More
I am just a learner who likes to delve in... Read More
Are you aware that 90% of the websites on the... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
So you've decided to start an online work at home... Read More
Everyday thousands of new businesses make the leap and take... Read More
After having decided to start a business, the next thing... Read More
The Internet is being used by local service business to... Read More
The DDA (Disability Discrimination Act) states that service providers must... Read More
Having an eye catching website is great, but are you... Read More
1. As the first step, "Hire a web designer."First create... Read More
There have been many significant changes to the face of... Read More
licensed cleaning services Park Ridge ..Let's begin by setting some limits. If you're like me,... Read More
After deciding what kind of internet business you want to... Read More
Mini Websites are the most powerful and cost effective solution... Read More
One of the things that Internet excels is disseminating information... Read More
Creatively marketing your corporate site takes time in the set... Read More
1. Address your targeted audience on your business site. Example:... Read More
It may seem like the publishing industry's equivalent of Beanie... Read More
The Internet has opened a whole New World of opportunity... Read More
Here's something you may never have thought of before:If I... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
Just starting out, you can start with a simple informational... Read More
Thousands of people are now making a living online and... Read More
Does your website have a links/resources page?Do you exchange reciprocal... Read More
They might not be wearing a mask and carrying a... Read More
Although designing a great web site is an important part... Read More
Writing for the web is totally different to writing for... Read More
Are bloated images slowing down your web site and causing... Read More
This is a growing concern amongst many business owners. Does... Read More
Looks like every client wants a Flash site these days... Read More
Is your website Really useful?I had a 'rep' in yesterday... Read More
Analyzing traffic to a site is a key factor in... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
Web templates by nature are created to aid and ease... Read More
SiteSpinnerSiteSpinner is a user-friendly web site development tool that includes... Read More
Every good Internet business understands the value of conversions versus... Read More
Web Development |