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? 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. 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 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. 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
Archived
This topic is now archived and is closed to further replies.