vbnullchar Posted February 12, 2007 Share Posted February 12, 2007 how do i clear post data Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted February 12, 2007 Share Posted February 12, 2007 unset($_POST); Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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.