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
Looks like every client wants a Flash site these days... Read More
Most web sites are more like stage sets than real... Read More
I recently helped my mom to launch a website (www.mom2me.com)... Read More
When I started my company in 2002, I knew I... Read More
Design and layout can make your communication come alive and... Read More
"I am a writer, not a business-person. I don't want... Read More
What is CSS?CSS is a simple file which controls the... Read More
In this example I have used the map of the... Read More
A system development process can follow a number of standard... Read More
Huge Mistake #1: Creating a Website with Flash -- Did... Read More
While studying online for IT investment opportunities, I found that... Read More
That's right. Your method, behavior and strategy you are now... Read More
Did you know that hosting companies overcrowd their servers despite... Read More
Fresh website content for your visitors can be of real... Read More
The internet is a sea of knowledge. Getting your information... Read More
The art of turning website visitors into paying customers depends... Read More
Designing an E-commerce Web site is not as simple as... Read More
Optimal website design is the art of logical navigation.It will... Read More
Creating and maintaining an effective presence on the Web has... Read More
It never ceases to amaze me how many people set-up... Read More
We've all seen those messages on some websites warning not... Read More
The process of Web application development is critical to the... Read More
Like any area of business your website needs some effort... Read More
Your site is getting traffic, but conversion rates are horrible.... Read More
Although designing a great web site is an important part... Read More
reliable maid service Lincolnshire ..We've all seen those messages on some websites warning not... Read More
Developing a website with content that entices visitors to return... Read More
One of the things that Internet excels is disseminating information... Read More
Through the explosive growth of the Web, companies have realized... Read More
The big thing these days is your ability to capture... Read More
No matter the size of your business, having a web... Read More
If you ever want to create a state directory, article... Read More
Some left shoes are in isle 5, while the right... Read More
You hear a great deal about the Internet these days... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
When people think about the Internet, they think about technology.... Read More
With all of the factors involved in designing and building... Read More
Failure, just like success, is measured differently by each and... Read More
How many Web Sites did you stumble over telling you... Read More
In this day and age most businesses consider having their... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
When you purchase a new item from a Yahoo! Store,... Read More
After deciding what kind of internet business you want to... Read More
When marketing your website, it's important to know which of... Read More
There are millions and millions of websites on the Internet.... Read More
In the big, wide online world there are millions of... Read More
A system development process can follow a number of standard... Read More
Simply ensuring your website is accessible to screen reader users... Read More
QUESTION: Should I build and maintain my business Web... Read More
What you should do and know if you are an... Read More
Web Development |