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
The Internet car buyer is an elusive animal. Trying to... Read More
An accessible Web site is easily approached, easily understood, and... Read More
Knowledge is power.And undoubtedly, it is the key to making... Read More
Server Side Includes (SSI) with ASP People often... Read More
In 1995 a new era of accessibility for disabled people... Read More
There are millions and millions of websites on the Internet.... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
When people think about the Internet, they think about technology.... Read More
The evolution of web development parallels the model of technology... Read More
Creating a content management system either from scratch,... Read More
A website lets you put your products in front of... Read More
Everyday thousands of new businesses make the leap and take... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
Although designing a great web site is an important part... Read More
Do you make your website just to entertain yourself or... Read More
Just starting out, you can start with a simple informational... Read More
If you haven't made the sales and built your clients... Read More
There are hundreds of millions of Web surfers today. Each... Read More
I am just a learner who likes to delve in... Read More
If you were asked to put a value on your... Read More
Fresh website content for your visitors can be of real... Read More
When visitors add your web site to their Favorites or... Read More
How many Web Sites did you stumble over telling you... Read More
1. Upload robots.txt file in to your root directory and... Read More
If you are looking for creating your online presence you... Read More
scheduled maid service Winnetka ..Understanding and using web analytics.In recent years, website marketers were... Read More
So you want to have a website. You have gone... Read More
Through the explosive growth of the Web, companies have realized... Read More
First, using a lot of web graphics, flash, banners and... Read More
A PHP Redirect automatically transfers a web user from one... Read More
cPanel is a control panel for your website and allows... Read More
Your business website is a critical aspect of being able... Read More
There is an ongoing debate about web copy. Some say... Read More
This article was prompted by some customer support work I... Read More
1) Word of Mouth The single most powerful form of... Read More
So you've decided to start an online work at home... Read More
Do you make your website just to entertain yourself or... Read More
It's now easier than ever to take payments on the... Read More
Starting a business online is no longer as difficult as... Read More
We've all seen those messages on some websites warning not... Read More
You've put up a website to promote a product or... Read More
A website provides invaluable advantages for businesses who have one.7... Read More
Even with the steady growth of the World Wide Web,... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
Many web developers today are starting to KISS their website,... Read More
Visitors to your site come looking for information or solutions... Read More
So you finally decided to invest in a web presence... Read More
After years of working with entrepreneurs who developed their first... Read More
Designing an E-commerce Web site is not as simple as... Read More
Web Development |