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
Writing for the web is totally different to writing for... Read More
I had a client say something to me the other... Read More
Before you jump into spending coutnless hours on designing and... Read More
Do you need a web site? Are you considering getting... Read More
QUESTION: Should I build and maintain my business Web... Read More
If you're looking for better web site ROI, chances are,... Read More
1. SiteSpinner V2 - On Sale www.deprice.com/sitespinner.htmSiteSpinner is a user-friendly... Read More
1. Address your targeted audience on your business site. Example:... Read More
Making maximum profit from your law firm website is important,... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
When used to describe a web site, the term "sticky"... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
A PHP Redirect automatically transfers a web user from one... Read More
A website is lifeline of internet home business. In order... Read More
The first step in setting up an online business...Starting an... Read More
Understanding and using web analytics.In recent years, website marketers were... Read More
Fantastico is a 3rd-party cPanel add-on and can be purchased... Read More
Most people know they need a website in order to... Read More
I am just a learner who likes to delve in... Read More
You hear a great deal about the Internet these days... Read More
Launching a new small business website is often a long... Read More
Project Safekids provides webmasters a valuable tool which could save... Read More
Most interactive websites nowadays would require a user to log... Read More
Many of site owners still don't realize all advantages of... Read More
Your website conversion rate should concern you. This simply refers... Read More
reliable maid service Wilmette ..In this day and age most businesses consider having their... Read More
More and more businesses are recognizing the importance of content... Read More
Most web sites are more like stage sets than real... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
You know exactly what your organisation does and what your... Read More
Thousands of people are now making a living online and... Read More
Like most average persons, I wanted some extra money to... Read More
Succeeding with an eCommerce website is a dream for many... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
If you like the Internet and surfing through the billions... Read More
Are you aware that 90% of the websites on the... Read More
Writing for the web is totally different to writing for... Read More
The Internet has opened a whole New World of opportunity... Read More
While it may seem like a "quick and easy" task,... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
Website, website, website, everyone says you need one. But do... Read More
What is web accessibility & why is it important?Web accessibility... Read More
When you publish a content site there are times when... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
Selecting the Perfect Domain NameThe first issue I have with... Read More
Designing an E-commerce Web site is not as simple as... Read More
You don't believe in astrology but you check your horoscope... Read More
A website is lifeline of internet home business. In order... Read More
Mini Websites are the most powerful and cost effective solution... Read More
Web Development |