# PHP error message

**URL:** <https://forum.kirupa.com/t/php-error-message/18721>\
**Category:** programming\
**Created:** [April 20, 2003, 4:10am UTC](https://forum.kirupa.com/t/php-error-message/18721 "2003-04-20T04:10:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_X](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Mr\_X](https://forum.kirupa.com/u/Mr_X)\
**Post date:** [April 20, 2003, 4:10am UTC](https://forum.kirupa.com/t/php-error-message/18721/1 "2003-04-20T04:10:17Z")

</div>

I had this little mail form working fine but now that I changed to new hosting company, I get this message on top of page:

```auto
Warning: Cannot add header information - headers already sent by (output started at /home/mrxsssco/public_html/thanks.php:9) in /home/mrxsssco/public_html/thanks.php on line 14

```

amyone knows what that’s supposed to mean? thx!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 20, 2003, 6:50am UTC](https://forum.kirupa.com/t/php-error-message/18721/2 "2003-04-20T06:50:28Z")

</div>

that means you have a line break, white space or script between the opening php tag and your headers, which scr\*\*\* it up, headers gotta go first!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 20, 2003, 5:33pm UTC](https://forum.kirupa.com/t/php-error-message/18721/3 "2003-04-20T17:33:52Z")

</div>

mmm…

I’m definitly not a PHP guru or anything like that. I just figured it would be the easiest way to get a little mail form on my site…

I dont see anything wrong with my syntax, but even tho I checked, tha’s probably what it is…

Here’s the file, it’s very short, and it should only take 10 sec for one of the Kirupa gurus to figure it out 😉

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 20, 2003, 5:35pm UTC](https://forum.kirupa.com/t/php-error-message/18721/4 "2003-04-20T17:35:43Z")

</div>

I guess you can’t ul files w/ .php  
oops! I zipped it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 21, 2003, 2:33am UTC](https://forum.kirupa.com/t/php-error-message/18721/5 "2003-04-21T02:33:18Z")

</div>

You have to set the cookie before the HTML. I have never done it before but I think if you just put the PHP before the HTML code, you should be all set.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 21, 2003, 2:48am UTC](https://forum.kirupa.com/t/php-error-message/18721/6 "2003-04-21T02:48:00Z")

</div>

that works!  
I understand what I was doing wrong now, my PHP file calls another one w/ HTML formatting already in it, so it was redundant. I actually remove all the HTML from this particular page since it’s just the action that’s called by the “submit” form, it sets cookies and e-mail the message…  
I don’t know why it was working fine on my previous hosting company tho…  
Thanks a bunch! I learned a little more about PHP thx 2 u! 🙂
