How can i remove echo $_POST in my text once I pressed my reset button? here’s my code, I think this is right but it doesn’t work at all.
HTML
<input type="text" class="text" name="email" value="<?php if(isset($_POST['email'])) echo $_POST['email']; ?>"/>
<input type="reset" value="Clear" name="reset" />
PHP
if (isset($_POST['reset'])){
unset($_POST);
}
Website Reference: http://www.veryinternational.net/skunk5/page-4.php
Note: Try to fill up one of the required field(marked with red asterisk) and press the first button on left. Try to press the second button, the message on the textbox must be cleared.
You have two versions of reset here:
This resets the HTML form to its original state, before the user made any input. Meaning, the data you have already put there when generating the page will stay there. This is how the linked page does it.
This would submit the form in the currently filled state. But, as you made the button a submit button, you will have
["reset"]=> string(5) "Clear"in your$_POSTor$_GETdata. I think this is more what you were looking for.