Help with feedback form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

To answer your headers sent error message, you cannot use header() if you have already sent something to the browser (even a blank space will cause this). You can use output buffering, but that is a band-aid approach in my opinion.

the trick is to take your form data, validate it, then assign it (or assign/validate) then put it into use. header() when you are done, but only before sending content to the browser.
keress
Forum Newbie
Posts: 22
Joined: Thu Jul 14, 2005 5:25 pm

Post by keress »

I got rid of the error message by cleaning up extra spaces. I got it to stop outputting it as HTML code instead of a formatted message by putting back the $additional_headers variable in the header command and uncommenting it at the top. I'm curious now what this variables is, and why it made such a difference.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

The additional headers are used to send information to sendmail so it knows what to do with the message. This should have had no effect on the output, only the message.
Post Reply