aceband Posted August 2, 2009 Share Posted August 2, 2009 Hi there, Currently I've got a login script that uses the typical if(isset($_POST['submit'])) and if its successful i use header("Location: page.page") to redirect to a new page and have the cookies loaded (manual says the cookies don't show until refresh i believe) but the problem is if they press the back button in their browser it asks if they want to resubmit the data - log in again although they are logged in. Although not a major problem for my login script i can see this being an issue when posting say new forum posts etc because i don't want to allow double posting etc. How can i get around this? Thanks Link to comment https://forums.phpfreaks.com/topic/168500-redirect-without-resubmitting/ Share on other sites More sharing options...
watsmyname Posted August 2, 2009 Share Posted August 2, 2009 Hi there, Currently I've got a login script that uses the typical if(isset($_POST['submit'])) and if its successful i use header("Location: page.page") to redirect to a new page and have the cookies loaded (manual says the cookies don't show until refresh i believe) but the problem is if they press the back button in their browser it asks if they want to resubmit the data - log in again although they are logged in. Although not a major problem for my login script i can see this being an issue when posting say new forum posts etc because i don't want to allow double posting etc. How can i get around this? Thanks I think its browser specific, i.e. there is now way to handle it so far i know. BTW why would someone hit browser's back button after they login? Link to comment https://forums.phpfreaks.com/topic/168500-redirect-without-resubmitting/#findComment-888995 Share on other sites More sharing options...
Fadion Posted August 2, 2009 Share Posted August 2, 2009 As the previous poster said, it is a browser feature and you can't do anything about it. If you want to stop users from re-posting (it will be quite improbable anyway), create a cookie or session when the post is made and don't allow them to re-post if 1 minute has passed. Link to comment https://forums.phpfreaks.com/topic/168500-redirect-without-resubmitting/#findComment-889013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.