1.

How May A Cgi Control Duplicate Inputs?

Answer»

When you have a CGI (like an Order Entry) receiving input from a form, the danger always exists that the user incorrectly sends duplicate inputs.

There are two main cases where this is possible.

Case 1The user enters by mistake an order line equal to the last previously submitted.

This can be controlled in this way:

  1. Have the CGI resending the last processed data in a HIDDEN input field of the form
  2. Have some javascript to submit the form. This javascript --before submitting the form-- would check that the new input data are different from the previous ones.

Case 2: The user by mistake presses the REFRESH / Reload button of the browser (I.E. supports also F5 for page reload). In this case, the browser would resend the last TRANSACTION

One way a CGI could control this would be to:

  1. Have the CGI assigning a transaction sequence number and storing it in a hidden input field of the form
  2. Once the CGI receives the transaction, it could check whether this transaction sequence number was already processed. If so, it would ignore the request and issue an error message. Otherwise, it would process the transaction and file this transaction sequence number. This of COURSE requires a transaction sequence number file to be available.

When you have a CGI (like an Order Entry) receiving input from a form, the danger always exists that the user incorrectly sends duplicate inputs.

There are two main cases where this is possible.

Case 1: The user enters by mistake an order line equal to the last previously submitted.

This can be controlled in this way:

Case 2: The user by mistake presses the Refresh / Reload button of the browser (I.E. supports also F5 for page reload). In this case, the browser would resend the last transaction. 

One way a CGI could control this would be to:



Discussion

No Comment Found