detect that user has refreshed the page

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
User avatar
jazz090
Forum Contributor
Posts: 176
Joined: Sun Apr 12, 2009 3:29 pm
Location: England

detect that user has refreshed the page

Post by jazz090 »

im running this mysql command and once the user fills out the form and clicks next, they are transfered to another section and a row is inserted into a mysql database. however if the user hits F5 or whatever and refreshed the page, the row is re-entered into the database. is there anyway to detect with sessions these kinds of behaviour?
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Re: detect that user has refreshed the page

Post by mickd »

You could just use a session to store which 'section' they are at, and thus when they go back to the page (by refresh or anything), it'll check the session and continue from there.
Post Reply