Q695 Posted February 18, 2009 Share Posted February 18, 2009 How do you create a form that only submits data once when someone submits data in a form, and doesn't ask for it to be done again? Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/ Share on other sites More sharing options...
noober Posted February 20, 2009 Share Posted February 20, 2009 Try to better explain your problem. I'm not sure anyone understands what you mean in your post. Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-766767 Share on other sites More sharing options...
Q695 Posted February 20, 2009 Author Share Posted February 20, 2009 When you log in once, it asks you if you want to log in again, when you refresh the logged in page. Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-766794 Share on other sites More sharing options...
haku Posted February 20, 2009 Share Posted February 20, 2009 Add a check at the top of your script to see if the person is logged in or not. If they are, then instead of the login form, output a message that says 'you are already logged in' or something. Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-766871 Share on other sites More sharing options...
Q695 Posted February 20, 2009 Author Share Posted February 20, 2009 I was giving an example that could be applied to e-mail, updating a profile, et al. Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-767092 Share on other sites More sharing options...
haku Posted February 21, 2009 Share Posted February 21, 2009 Then we are back to this problem: How do you create a form that only submits data once when someone submits data in a form, and doesn't ask for it to be done again? Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-767579 Share on other sites More sharing options...
Q695 Posted February 21, 2009 Author Share Posted February 21, 2009 What's the answer? Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-767669 Share on other sites More sharing options...
haku Posted February 21, 2009 Share Posted February 21, 2009 I don't know - the question didn't make sense. Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-767695 Share on other sites More sharing options...
Q695 Posted February 22, 2009 Author Share Posted February 22, 2009 posting information, and refreshing the page causes you to resubmit the data again. Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-768300 Share on other sites More sharing options...
haku Posted February 23, 2009 Share Posted February 23, 2009 Now we are getting somewhere. To prevent this, you need to put your processing script on a different page than the form. After the processing is finished, you use a header call that forwards the user to another page. In this way, if they refresh, they are only refreshing the page they have been forwarded to, and if they click back, they are taken to the page with the form, not the page with the processing. Quote Link to comment https://forums.phpfreaks.com/topic/145827-form-submission-data/#findComment-768857 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.