Copy link to clipboard
Copied
Does anyone know how to stop a Coldfusion insert statement from doing it again if someone refreshes their browser? I have really never thought about this before and my mind is drawing a blank.
So right now I have a form that passes variables to an insert statement, problem is if someone refreshes the page it will insert again. I need to not allow this.
Thanks in advance for any help.
A couple of common simple solutions is to do a <cflocation...> or some other redirect to another page so that if they refresh that page, the insert CFML is not run again OR to set some type of session or other flag that indicates the insert has been done and to not do it again.
Copy link to clipboard
Copied
A couple of common simple solutions is to do a <cflocation...> or some other redirect to another page so that if they refresh that page, the insert CFML is not run again OR to set some type of session or other flag that indicates the insert has been done and to not do it again.
Copy link to clipboard
Copied
Thanks, my brain is mush today. I just added a redirect after the insert statement to another page. That way if it gets refreshed nothing happens.