You cannot just delete $_POST
data from the server. The browser warns about this because it is stored in the browser. If he resubmits the data, he sends them back to the server and closes $_POST
again
This can be done by setting the cookie / session
variable, which indicates that the form has already been processed.
<?php session_start(); ?> <!DOCTYPE html > <head> <title>Refresher test</title> </head> <body> <br/><br/><h2>What Me Refresh</h2> <?php <p><h3>Enter text in the box then select "Go":</h3></p> <form method="post" action="" > <textarea rows="5" cols="50" name="text" > </textarea> <input type="submit" name="submit" value="Go" /> </form> <?php } ?> </body> </html>
Remember to clear the action, as you already mentioned (in bold) All on one page
<form method="post" action="RfrshTst.php" > ^--Here^
source share