Page 1 of 1

page refresh

Posted: Sat Nov 04, 2006 3:58 am
by navid
hello everybody

how can distingush page was refreshed by php ?
Ihave a form. information in form insert to database when the form was submited.
but I have a problem , every time that page was refreshed the data was insert in DB so the data insert to DB More than once.

Posted: Sat Nov 04, 2006 5:34 am
by amir
Please post your code so that we could have a look!

Posted: Sat Nov 04, 2006 6:40 am
by timvw
Here's a pretty simple solution: add a unique id to each form that you generate.. this way you can keep track exactly which form has been posted back.. and decide whether or not you're still accepting the values... (in order to prevent users tampering this 'unique id' i'd advise to keep a link between the id and the user... this way they can only mess with theirselves ;))