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
Q. Hey, Cathy: I'm just setting up a website. What... Read More
If you have your own business website and you are... Read More
Customer service questionnaires can help your clients better understand their... Read More
Failure, just like success, is measured differently by each and... Read More
There's been widespread speculation about the new legislation being introduced... Read More
"'Page Not Found' on this Server. Check the URL and... Read More
If you haven't made the sales and built your clients... Read More
Creatively marketing your corporate site takes time in the set... Read More
A website is the most versatile and cost-effective marketing tool... Read More
I've heard several prominent web marketers mention in their classes... Read More
One of the things that Internet excels is disseminating information... Read More
See how you can create graphic effects on text with... Read More
When we review the sites of potential clients, there are... Read More
The process of Web application development is critical to the... Read More
1. Choose a big enough font size. A size 12... Read More
If one more business owner tells me their website sucks... Read More
They might not be wearing a mask and carrying a... Read More
Have you ever thought the secret behind the success of... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
Fresh website content for your visitors can be of real... Read More
How can we add Word Rich Content to our Websites... Read More
Having an eye catching website is great, but are you... Read More
The art of turning website visitors into paying customers depends... Read More
Like most average persons, I wanted some extra money to... Read More
I'm one of those people that always wanted a website,... Read More
car service from Midway Alsip ..If you have your own business website and you are... Read More
Most people know they need a website in order to... Read More
Most interactive websites nowadays would require a user to log... Read More
The Internet car buyer is an elusive animal. Trying to... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
"Don't Sell the Steak, Sell the Sizzle."Have you heard of... Read More
Looks like every client wants a Flash site these days... Read More
Before you jump into spending coutnless hours on designing and... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
What is web accessibility & why is it important?Web accessibility... Read More
Your content is what gets you in search engines, speaks... Read More
Part of the success of most home-based businesses is their... Read More
When you started reading this sentence you assumed lo acabar?a... Read More
After years of working with entrepreneurs who developed their first... Read More
In 1995 a new era of accessibility for disabled people... Read More
There are lots of HTML editors on the market, however,... Read More
A system development process can follow a number of standard... Read More
Do you need a web site? Are you considering getting... Read More
Succeeding with an eCommerce website is a dream for many... Read More
"I have a small business with just a couple of... Read More
Designing and creating your own website does not have to... Read More
Never has competition been so difficult in the Internet world.... Read More
You've just finished congratulating your marketing team. After six months... Read More
In my previous life.....Actually, my previous JOB life, I was... Read More
1. Upload robots.txt file in to your root directory and... Read More
Web Development |