PHP POSTDATA & Refresh

Associate
Joined
18 Oct 2002
Posts
249
Location
Glasgow
Hi folks

Wonder if anyone can give me a pointer in dealing with a refresh on a page that inserts data into a database via POSTDATA. If i refresh it enters it again. Is my best bet a page redirect after submitting to database?
 
when posting to a database, i dont sit on the page that handles the query, as it can result in multiple duplicate posts to the database. after you've gone through your post query, redirect to a "thanks for your submit" page, and that should stop refreshing annoyance. just use a header("location: ....");
 
you should be checking for duplicate entrys proir to inserting into the database anyway via form handling, well thats how I do it anyway.
 
Back
Top Bottom