I have a HTML form with information. If the submitted data is incorrect an error message will appear with a back button. A session with the submitted data is stored and filled in the form field when the user press the back button.
But I want the session to unset if the user update the site (like press F5). How can I do this?
I use this to show the stored data in the field when the user press the back button:
<b>Comment</b><br>
<textarea cols="50" rows="6" name="text">' . $_SESSION['text'] . '</textarea>
I can use unset($_SESSION['text']);
at the top of the page but then the data will not show in the form. Any idea?