dantalion Posted July 11, 2006 Share Posted July 11, 2006 Hi,Is there a method for deleting $_POST variables from a session (so that if a page is reloaded they will not exist anymore) without destroying the entire session? Quote Link to comment https://forums.phpfreaks.com/topic/14304-how-to-delete-_post-variables-without-deleting-the-session/ Share on other sites More sharing options...
Daniel0 Posted July 11, 2006 Share Posted July 11, 2006 [code]unset($_POST['what_ever']);[/code]Should do it. Quote Link to comment https://forums.phpfreaks.com/topic/14304-how-to-delete-_post-variables-without-deleting-the-session/#findComment-56291 Share on other sites More sharing options...
kenrbnsn Posted July 11, 2006 Share Posted July 11, 2006 Deleting $_POST variables will not affect what happens on reload, that is controled by the browser. If you reload a page that has a form, the form data is resent and the $_POST variables will be reloaded. You need logic in your script that will act accordingly if a page is reloaded.Ken Quote Link to comment https://forums.phpfreaks.com/topic/14304-how-to-delete-_post-variables-without-deleting-the-session/#findComment-56295 Share on other sites More sharing options...
ShogunWarrior Posted July 11, 2006 Share Posted July 11, 2006 Usually the best way to do it is:Form.html (send to process page) -> Process.php (Redirect to "Thank You") -> ThankYou.htmlThat way, they are moved along the chain to a thank you/email sent etc. and can't reload. Quote Link to comment https://forums.phpfreaks.com/topic/14304-how-to-delete-_post-variables-without-deleting-the-session/#findComment-56420 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.