-3

I have a contact form that is setup as so: contact page > contact handler > thank you

When testing out my form, all emails are going through, however I get an error on my contact handler page:

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c03/h03/mnt/168570/domains/mikesbaum.com/html/index.php:11) in /nfs/c03/h03/mnt/168570/domains/mikesbaum.com/html/pages/contact_handler.php on line 10

I have this on line 10:

header("location: thankyou.php");?>

And I have also tried

exit(header("location: thankyou.php"));?> as mentioned on previous posts. Any help is appreciated!

Truffleshfl
  • 15
  • 1
  • 5
  • if you have echo'ed only one white space, or for some reason you have php embed in html and you add the header call, you get this error. In order to avoid it, make sure you don't output anything before your header call, not even a white space. – Twisted1919 May 23 '13 at 18:17

2 Answers2

0

This is very common problem with header. Just put ob_start() at the start of your php code. To know more about it read here

chandresh_cool
  • 11,753
  • 3
  • 30
  • 45
0
header("location: thankyou.php");
exit;
Haben
  • 95
  • 5