vbnullchar Posted February 12, 2007 Share Posted February 12, 2007 how do i clear post data Link to comment https://forums.phpfreaks.com/topic/38150-_post-date/ Share on other sites More sharing options...
ToonMariner Posted February 12, 2007 Share Posted February 12, 2007 unset($_POST); Link to comment https://forums.phpfreaks.com/topic/38150-_post-date/#findComment-182606 Share on other sites More sharing options...
vbnullchar Posted February 12, 2007 Author Share Posted February 12, 2007 it didnt clear the $_post data after i hit submit then press F5 Link to comment https://forums.phpfreaks.com/topic/38150-_post-date/#findComment-182614 Share on other sites More sharing options...
ToonMariner Posted February 12, 2007 Share Posted February 12, 2007 when you hit F5 the data will be sent again so it will be placed back into the POST array. The post array is stateless anyway - so expecting it to do something different when you repeat a submit is a bit daft - it is populated on a request and emptied at the end of the processing of the request if you repeat the request then it will be populated once more. If you put unset($_POST); at the very top of your script and then submit you should see that the post array is cleared. If you are trying to prevent a double posting of a comment or similar then you should process the data and the use.. header('Location: donepage.php'); This will prevent a fresh sending the data once more. Link to comment https://forums.phpfreaks.com/topic/38150-_post-date/#findComment-182626 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.