I would like to tell you how to avoid double data loading to the impatient user and press refresh in the browser. I’ve seen this problem in even, many programs online shopping, resulting in that the user receives duplicate order, and it is also invoiced twice. Notice that the basic procedure that I’m going to describe is not dependent on the database (although use MySQL in my example) nor the language of programming (PHP) or operating system (Linux). It would also serve if SQL Server, with ASP.NET, Windows Server 2008, although with its own syntax. It is not necessary to say that users are not very happy with us. Yes, the problem was caused by them, but we still had the responsibility to handle the situation better.
Let me explain this procedure with an example, that mode is now quite clear. Create a form on values of purchase to a table that contains at least the following information: the customer’s name, date, invoice number, value. First that nothing, Let me show you the tools that I’ll use: object function Control Hidden pass information controlled by javascript or HTML and not by the user. Column with index only prevents that get the same value in more than a row in the table. Generator generates random strings a string for single.
Our table will be called Bills. This is what I’ll do: generate a unique code randomly. Move that code to the browser. The browser returns me this code, along with the rest of the information. The code is stored with the info, indexed with a unique index. Thus, if customer recharges page and the information is loaded twice, the first time all go well. But the second time I have a unique index violation and will be rejected by the database engine. Are you interested in this solution? Leela completely on my web site.