Mutley Posted April 11, 2007 Share Posted April 11, 2007 Is there a method to stopping a form refreshing? So when you submit a form, you can't hit refresh and submit the data again? Link to comment https://forums.phpfreaks.com/topic/46628-stop-form-refresh/ Share on other sites More sharing options...
paul2463 Posted April 11, 2007 Share Posted April 11, 2007 if the form submits data to a database you can always check to see if that data exists in the database onSubmit(), if it does do nothing, if not put it in or update it. Link to comment https://forums.phpfreaks.com/topic/46628-stop-form-refresh/#findComment-227046 Share on other sites More sharing options...
per1os Posted April 11, 2007 Share Posted April 11, 2007 The best way is once the data has been entered, send it to another page via header("location"); that states it was updated, this will clear the post data from memory. Link to comment https://forums.phpfreaks.com/topic/46628-stop-form-refresh/#findComment-227052 Share on other sites More sharing options...
boo_lolly Posted April 11, 2007 Share Posted April 11, 2007 as frost mentioned, $_POST data is not only handled by php, but also by your browser. this makes it damn near impossible to remove $_POST data once it has been submitted. Link to comment https://forums.phpfreaks.com/topic/46628-stop-form-refresh/#findComment-227056 Share on other sites More sharing options...
Mutley Posted April 11, 2007 Author Share Posted April 11, 2007 I can redirect to another page, that's easy, just how can I display a confirmation message then? Link to comment https://forums.phpfreaks.com/topic/46628-stop-form-refresh/#findComment-227061 Share on other sites More sharing options...
per1os Posted April 11, 2007 Share Posted April 11, 2007 <?php //processing here header("Location: http://www.yoursite.com/thankyou.php?msg=Thank you, we will get back to you ASAP!"); ?> thankyou.php <?php print $_GET['msg']; ?> Just like that =) Link to comment https://forums.phpfreaks.com/topic/46628-stop-form-refresh/#findComment-227064 Share on other sites More sharing options...
Mutley Posted April 11, 2007 Author Share Posted April 11, 2007 Hehe, yeah I just did it like that. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/46628-stop-form-refresh/#findComment-227069 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.