on refreshing the window twice the form variables come back.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
localhost
Forum Commoner
Posts: 43
Joined: Tue Dec 07, 2004 4:52 am
Location: islamabad
Contact:

on refreshing the window twice the form variables come back.

Post 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...
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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.
Post Reply