poolhustler86 Posted March 17, 2008 Share Posted March 17, 2008 After submitting a form via php, and i redirect the user to another page.. that works fine. however once the user clicks on the back button they get the warning page by the browser about form data has been already submitted... how can i avoid all together the user getting a page like that? Quote Link to comment https://forums.phpfreaks.com/topic/96620-form-back-pages/ Share on other sites More sharing options...
Psycho Posted March 17, 2008 Share Posted March 17, 2008 What do you want to happen when the user clicks the back button? What you want will determine the solution. Quote Link to comment https://forums.phpfreaks.com/topic/96620-form-back-pages/#findComment-494450 Share on other sites More sharing options...
roopurt18 Posted March 17, 2008 Share Posted March 17, 2008 How are you redirecting? If you redirect as soon as you process the request using header('Location: ...') then they should not get the warning from going back. If you're using a meta tag or Javascript then you will keep getting it. Quote Link to comment https://forums.phpfreaks.com/topic/96620-form-back-pages/#findComment-494463 Share on other sites More sharing options...
poolhustler86 Posted March 17, 2008 Author Share Posted March 17, 2008 the form submits, processes on the same page and then redirects the user from header: location function... basically if the user clicks back, i dont mind if they see the previous page.. just dont want those warning messages, page expired messages... so when they do click refresh it resubmits the data again. Quote Link to comment https://forums.phpfreaks.com/topic/96620-form-back-pages/#findComment-494466 Share on other sites More sharing options...
roopurt18 Posted March 17, 2008 Share Posted March 17, 2008 Something is funny then. I show, validate, and process my forms all in one script and part of my processing is to redirect with a call to header(). I have zero problems with duplicate submissions. Is it possible the page that generates the form is itself the result of a post operation? Quote Link to comment https://forums.phpfreaks.com/topic/96620-form-back-pages/#findComment-494469 Share on other sites More sharing options...
poolhustler86 Posted March 17, 2008 Author Share Posted March 17, 2008 any chance i can see how ur script looks... compare to mine... cause it happens on alot of my forms.. and i just $_SERVER['php-self']; Quote Link to comment https://forums.phpfreaks.com/topic/96620-form-back-pages/#findComment-494474 Share on other sites More sharing options...
poolhustler86 Posted March 17, 2008 Author Share Posted March 17, 2008 please ignore the above post, i hit the wrong button... my apologises.. basically in the form action i put the php self so it would refresh the page when the button is clicked, or enter is hit.. and in the method i put post.. Quote Link to comment https://forums.phpfreaks.com/topic/96620-form-back-pages/#findComment-494476 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.