Skip to main content
Inspiring
October 23, 2009
Answered

No action after a page refresh

  • October 23, 2009
  • 1 reply
  • 585 views

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.

    This topic has been closed for replies.
    Correct answer ilssac

    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.

    1 reply

    ilssac
    ilssacCorrect answer
    Inspiring
    October 23, 2009

    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.

    brianismAuthor
    Inspiring
    October 23, 2009

    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.