Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Raju V.K
January 28, 2005, 4:06 pm
rate this thread
browser window is refreshed the data is inserted again in the
database. unfortunately there is no unique keys that I can use to
verify the existance of the data, so as to prevent the multiple
insertion. Is there any other way to prevent it otherthan introducing
another field for this purpose and verifying its existance?
Re: Preventing multiple data insertion on page reload
You can use session variables to flag that the insert operation has
occurred once. i.e.
/* Do the insertion operation */
/* The value have already been inserted. */
Note that at the page which sends the data to the page which actually
does the insertion, you might want to unset the
$_SESSION["PAGE_NAME_INSERT"] variable. This is needed if the user
presses "Back" and then changes some values in the form and resubmits.
System Administrator, programmer and slacker
home : http://rajshekhar.net
blog : http://rajshekhar.net/blog /