Personally, I'd do both... ALWAYS make sure your not getting dupe entries... and cflocate to a different page once the query has ran its course.

Cflocate keeps them from just hitting refresh

THe query check will keep them from going BACK and hitting submit again (if the page doesnt expire)

  ----- Original Message -----
  From: joe velez
  To: CF-Talk
  Sent: Thursday, August 19, 2004 2:01 PM
  Subject: Re: stop insert when user presses refresh

  I would go with the checking to see if a record already exists with the same info .. you should only need to check 1 to a few columns for verification. If a record exists, just skip over the insert.

  joe

  >There a re a couple approaches depending upon how you handle the user
  >once the insert has been made.
  >
  >Use cflocation after the insert to send the user elsewhere. Or
  >
  >Param a session['processed'] variable at the top of the page, set it to
  >false.
  >Check the variable before inserting. If the variable is equal to false,
  >insert, then set the processed variable to "true".
  >
  >The problem however arises when do you clear that variable out!
  >
  >I like to use cflcoation instead.
  >
  >
  >
  >> How do you stop a database insert from occurring when a user
  >> presses refresh?
  >>
  >> I remember seeing posts regarding this but I can't seem to find them.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to