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
If you're anything like most small business owners, you probably... Read More
Psychology is a long word which everyone thinks, "no, that's... Read More
Do you need a web site? Are you considering getting... Read More
Designing and creating your own website does not have to... Read More
Simply ensuring your website is accessible to screen reader users... Read More
The Disability Discrimination Act says that websites must be made... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
Even with the steady growth of the World Wide Web,... Read More
More and more businesses are recognizing the importance of content... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
We've all seen those messages on some websites warning not... Read More
Every business needs to know how it is doing. That's... Read More
Recently I was reviewing the keyword specific conversion rate data... Read More
Making a web site is easy. Making a good web... Read More
Internet has opened a whole new world for web developers... Read More
There are millions and millions of websites on the Internet.... Read More
After deciding what kind of internet business you want to... Read More
Are you aware that 90% of the websites on the... Read More
Optimize your time. How much time each day must you... Read More
Recently, a friend asked "What's the deal with those DIY... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
Alternate medicine finds its own place in the hearts and... Read More
After having decided to start a business, the next thing... Read More
It amazes me how many people try to build serious... Read More
maid service near Winnetka ..If you are like me you have wanted to build... Read More
If you were asked to put a value on your... Read More
Knowledge is power.And undoubtedly, it is the key to making... Read More
If you don't have a web site yet, are thinking... Read More
If you've been developing websites on Mars for the past... Read More
A system development process can follow a number of standard... Read More
Most web sites are more like stage sets than real... Read More
Profiles are one of the best kept secrets around regarding... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
One of the things that Internet excels is disseminating information... Read More
--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
"I don't sell anything online, I don't advertise online, in... Read More
Go to any internet marketing forum you want these days... Read More
When I started my company in 2002, I knew I... Read More
If you're looking for better web site ROI, chances are,... Read More
How popular is online shopping? And is there room for... Read More
There's been widespread speculation about the new legislation being introduced... Read More
What is SQL? SQL stands for Structured Query Language and... Read More
When a user signs up at your website, you may... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
Many executives and investors are skeptical that software products can... Read More
The internet has taken over our lives with a vengeance,... Read More
A website is the most versatile and cost-effective marketing tool... Read More
Web Development |