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
You can't output anything to the screen before redirecting.
Remove all your echo
'es and print_r
's and you should be fine.
EDIT:
Also as @jhonraymos mentioned, be sure to use header()
properly. Maybe you changed this to hide your actual page you're redirecting to. Either add a local file with correct path definitions or if redirecting to an other domain, you need to define the full url. See Uniform resource locator if in doubt.
Another EDIT:
I see you updated your question. Stop trying indian magic, such as
if ($success){
print "";
Just accept the fact not to output ANYTHING to the screen before headers()
and your soul is safe forever. This is not the place to mix http-meta in. PHP can do this just fine.
This might sound as a limitation first, but believe me, it isn't. It's a blessing.