Forum Moderators: coopster

Message Too Old, No Replies

Quick question from newbie

Getting error messages with php script

         

aodhan

9:45 pm on Aug 8, 2004 (gmt 0)

10+ Year Member



When I try to log in to my php site I get a blank page with the following error

Warning: Cannot modify header information - headers already sent by (output started at /home/referral/public_html/paidmail/includes/vars.php:37) in /home/referral/public_html/paidmail/site/member_login.php on line 11

I need to know what this error means and what my best ways to fix it are
Thanks

coopster

10:14 pm on Aug 8, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, aodhan!

Remember that header() [php.net] must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.

Also remember that starting a session using cookies means you are again sending header information. Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place calls to this function prior to any output, including <html> and <head> tags as well as any whitespace.

aodhan

11:13 pm on Aug 8, 2004 (gmt 0)

10+ Year Member



Thanks alot. Problem fixed. I went to the two files and deleted all spaces in between code and after the code. It was these empty spaces after code or hidden characters that were causing my problem I think.

Thanks again.

mincklerstraat

3:57 pm on Aug 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you get this again, you can use ob_start() at the beginning of your code, and ob_end_clean() at the moment you're really sure you want to begin output.