Page 1 of 1

on refreshing the window twice the form variables come back.

Posted: Sat Dec 11, 2004 4:14 am
by localhost
in my code i am taking input from user and updating it in the database.and it works fine but when i refresh the window the last values i have entered are again submitted....but i tweaked the code a bit and now on the first refresh nothing happens but when the second time i refresh it again the form variables come back...

Posted: Sat Dec 11, 2004 4:34 am
by kettle_drum
-Redirect the page to somewhere else so that you dont refresh - if you wanting to go back to the same form - redirect to that form.

-Set a cookie or session to say that you have already updated the database and check it each time you load the page. Reset the cookie/session when you reload the original form so you can post new data.