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
Making a web site is easy. Making a good web... Read More
People often come to me in a state of crisis... Read More
I still remember it very clear ... It was almost... Read More
So you want to take a look at a real... Read More
Never has competition been so difficult in the Internet world.... Read More
"If you build it, they will come"; is an age... Read More
Designing an E-commerce Web site is not as simple as... Read More
While studying online for IT investment opportunities, I found that... Read More
A common dilemma most small and medium businesses face when... Read More
A website is lifeline of internet home business. In order... Read More
There is an ongoing debate about web copy. Some say... Read More
Project Safekids provides webmasters a valuable tool which could save... Read More
When building a relationship, listening is more important than talking.A... Read More
The first thing you will have to deal building your... Read More
A company must earn and keep trust or sales don't... Read More
Your web site will be your window to the world.... Read More
Many websites I come across don't have a single link... Read More
If one more business owner tells me their website sucks... Read More
There's been widespread speculation about the new legislation being introduced... Read More
You have permission to publish this article electronically, in print,... Read More
Many millions of dollars are being wasted on promoting and... Read More
QUESTION: Should I build and maintain my business Web... Read More
Web sites are an Ongoing Part of Business.All too many... Read More
Failure, just like success, is measured differently by each and... Read More
Before you jump into spending coutnless hours on designing and... Read More
efficient cleaning crew Highland Park ..Any new website competing on the internet, needs to take... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
The Disability Discrimination Act says that websites must be made... Read More
When most people build a web site, they think one... Read More
The first step in setting up an online business...Starting an... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
1. Upload robots.txt file in to your root directory and... Read More
Although there are significant differences among the various types of... Read More
Before you jump into spending coutnless hours on designing and... Read More
Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More
There are many different traffic analysis tools, ranging from simple... Read More
There are lots of HTML editors on the market, however,... Read More
Psychology is a long word which everyone thinks, "no, that's... Read More
Are you aware that 90% of the websites on the... Read More
The internet is a sea of knowledge. Getting your information... Read More
A while ago one of my clients approached me and... Read More
Many websites I come across don't have a single link... Read More
QUESTION: Should I build and maintain my business Web... Read More
Creating and maintaining an effective presence on the Web has... Read More
Have you ever wondered what challenges are faced by other... Read More
When marketing your website, it's important to know which of... Read More
When we review the sites of potential clients, there are... Read More
Three way linking and concerns.For many years SEO experts were... Read More
Although designing a great web site is an important part... Read More
Web Development |