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 are looking for creating your online presence you... Read More
Customer service questionnaires can help your clients better understand their... Read More
Although designing a great web site is an important part... Read More
Here's something you may never have thought of before:If I... Read More
One of the most useful features offered by some web... Read More
One of the biggest mistakes that most online retailers make... Read More
Before you jump into spending coutnless hours on designing and... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
Internet has opened a whole new world for web developers... Read More
If you are living in a country that its native... Read More
The following is a list of patterns that many visitors... Read More
When visitors add your web site to their Favorites or... Read More
What is CSS?CSS is a simple file which controls the... Read More
You know exactly what your organisation does and what your... Read More
When most people build a web site, they think one... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
There have been many significant changes to the face of... Read More
Like most average persons, I wanted some extra money to... Read More
We are clearly well past the innocent "golden age" of... Read More
Making maximum profit from your law firm website is important,... Read More
Are you aware that 90% of the websites on the... Read More
I am just a learner who likes to delve in... Read More
You have permission to publish this article electronically, in print,... Read More
Designing and creating your own website does not have to... Read More
For years now I've been looking to start my own... Read More
last minute cleaning help Highland Park ..If your company own one or more stores, you might... Read More
A website is lifeline of internet home business. In order... Read More
It never ceases to amaze me how many people set-up... Read More
One of my most salient memories from when I sold... Read More
Better Web Site ROIHow to increase your business profitability by... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More
An additional benefit of website accessibility is an improved performance... Read More
1. Many people are not getting good or complete advice.... Read More
Your site is getting traffic, but conversion rates are horrible.... Read More
The Disability Discrimination Act says that websites must be made... Read More
Your website conversion rate should concern you. This simply refers... Read More
So you've decided to start an online work at home... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
One of the things that many people overlook when building... Read More
The process of Web application development is critical to the... Read More
Writing for the web is totally different to writing for... Read More
Before you set up any scripts you will need some... Read More
What to do if you are an artist after you... Read More
In about the Time it takes to Watch a Reality... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
Your site is fast and getting traffic, but conversion rates... Read More
If you have some experience in web site design and... Read More
Alternate medicine finds its own place in the hearts and... Read More
Failure, just like success, is measured differently by each and... Read More
Web Development |