I im trying to redirect to my homepage after submitting a message on my contact form, the form sends the email but I get this message:
Array
(
[name] =&g
Headers are used to communicate with your client's browser. They're like little commands that the browser will perform when received. When you output any data (text,numbers,whatever), you're client's browser will print that data. After that, the browser will no longer be interested in any headers you send.
The header()
function is a function used to send custom headers. So when this function is called, headers are sent out to your client's browser.
Now you have a very brief understanding of what it is you're actually trying to do, you should be able to see where your problem lies.
You are outputting other data before sending those custom headers. This is what's triggering the error.
So this:
echo "";
print_r($_POST);
Should not be before this:
header('Location:mydomain');