If this is file_1.php
Look at it from the web server's perspective: it receives a request for file_1.php
, runs that PHP file, and sends back the result, which happens to include a Location:
header. Then some time later, it receives a separate request for file_2.php
, so it loads and runs that file and sends back the result, which is an HTML page. The point is, the two files are used in completely separate HTTP requests. Each one is run in a separate environment, so for example, any changes that are made to variables in one are not reflected in the other one. The $_POST
in the request for file_1.php
is a separate variable from the $_POST
in the request for file_2.php
.
As far as your actual question: I think you can write to $_POST
, but it's probably not recommended. That's not really what the variable is for.