ert3
ert3

Reputation: 114

Trying To Prevent Repost Data on refresh

working with pre existing code just a simple patch i added ontop

//first get the variables
bridge = namef & valuef
//a paranoid double check
if session("gap") = session("oldgap") then session("gap") = "null"
//the actual comparison
if bridge = session("gap") then
 drawbridge = ""
else
 drawbridge = inputscrubber("action")
end if
session("oldgap") = session ("gap")
session("gap") = namef & valuef

Upvotes: 0

Views: 176

Answers (1)

Oded
Oded

Reputation: 498942

You should use the PRG (Post/Redirect/Get) pattern to avoid such issues.

The idea is that once the form is posted, you process it and redirect to a different page. The user at this point can refresh without any issue.

Upvotes: 3

Related Questions