Answer the question
In order to leave comments, you need to log in
How to clear $_POST after page load?
Hello everyone, I can't clear $_POST after page load.
Form - Passing $_POST to itself - Then the script works, and it is necessary that $_POST be cleared when the page is updated, trying unset does not help. How to make $_POST only work for 1 page load?
Answer the question
In order to leave comments, you need to log in
In general, try to redirect to the same URL, if I understand your problem correctly.
For example:
header('Location: /test.php');
Read the http specification. $_POST is just a variable that php fills with the next request. If a POST request receives a 200 response, the browser saves the previously sent data in order to send it again before the GET request.
And the fact that you have an error falls out - look for where you call echo, or any other function that sends information to php: // stdout
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question