xenophobia Posted May 7, 2007 Share Posted May 7, 2007 Let say I have 2 php file: a.php : a form that let users to fill up. b.php : where data are processed from a.php. So after user fill up in a, the page will redirect to b. So my question is is there a way that prevent user to refresh/repost the form once they reach in b.php. Because once users click the refresh button in the browser in b.php, the whole process will repeated with same data. Which is very bad. Any idea? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/50315-solved-form-reposting/ Share on other sites More sharing options...
jitesh Posted May 7, 2007 Share Posted May 7, 2007 Keep form in a.php Do process in b.php and after process redirect to c.php. I mean process in b.php and show thank you or any other message or other activity at c.php. Quote Link to comment https://forums.phpfreaks.com/topic/50315-solved-form-reposting/#findComment-247000 Share on other sites More sharing options...
xenophobia Posted May 7, 2007 Author Share Posted May 7, 2007 Oh that's work. Even I haven't try, but the logic flow should be ok. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/50315-solved-form-reposting/#findComment-247005 Share on other sites More sharing options...
chronister Posted May 7, 2007 Share Posted May 7, 2007 Could you do something like this? It eliminates a page and gives more control over the user "experience" <?php if(!$_POST['name_of_submit_button']) { //Show Form Here } else { /* process form here and redirect to another page with all thank you's and such... that will make it so if the refresh button is hit, you are done with all the post data and it will simply refresh to the page you redirected to * */ } ?> Quote Link to comment https://forums.phpfreaks.com/topic/50315-solved-form-reposting/#findComment-247006 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.