How To Fit Different Parts In Site Modularization?
Posted 28 February 2012 - 1:42 AM
I'm including a link to contactform.html in index.php. Clicking that link loads contactform.html nicely. Once that form is filled and submitted, it shows error "headers already sent - output started at .. email.php. (email is sent out correctly.)
I have not included configer and header,footer file in contactform.html.
I have included configer and header,footer file in email.php.
Now I know, that we cannot include session start and header function, two times like this. Header file has actually started the session already as the error says. But, if I omit header and footer file from email.php, I lose all the formatting. And if I keep those files, it gives error of headers already sent.
The script runs well on my local machine. And the above problem comes on the live site.
contactfrom.html is loading nicely in content area with all the formats, but email.php is not loading into content area. I think this is the problem. But how to solve it?
Posted 28 February 2012 - 4:08 PM
Posted 29 February 2012 - 2:56 PM
Posted 29 February 2012 - 3:27 PM
when the encoding of your script file needs to send some headers just after your script starts to execute,
this happens mostly with the scripts using normal utf8 encoding.
To overcome the issue, use utf8(without BOM) encoding provided by notepad++ and most modern editors. Using utf8 encoding and cookie based sessions, will result in headers already sent by error.