PHP Post Unset Fully -


this question has answer here:

okay found out browsers try smart , remember form data if refresh. if click url bar , hit enter unset post data

is there way unset $_post data if u refresh it? (google chrome) has no way of remembering.

 <?php   if (isset($_post['loginsubmit']))  {      echo 'triggered';      unset($_post['loginsubmit']);     }  ?> 

by refreshing, re-sending post request. if "hit address bar" not re-send it, call teh url request. handled browser, not php.

you can use sessions prevent post data being comitted twice.

one way have token in forms, set in session (simply store in session uppon creating form).

if data submitted via post , processed (i.e. inserted database) check if token exists in session. after processing data delete token session.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -