Headers are used to communicate with your client browser. They look like small commands that the browser will execute when they are received. When you output any data (text, numbers, etc.), the Client browser will print this data. After that, the browser will no longer be interested in any headers you send.
The header() function is the function used to send custom headers. Therefore, when this function is called, headers are sent to your client browser.
Now you have a very brief idea of โโwhat you are actually trying to do, you should be able to see where your problem is.
You send other data before sending these custom headers. This is what causes the error.
So this is:
echo "<pre>"; print_r($_POST);
Should not be before this:
header('Location:mydomain');
user849137
source share