>I get the following error when i try to install an app
>called "PHPwebsite" ( http://phpwebsite.appstate.edu/ )
>Warning: Cannot add header information - headers already sent by
> (output started at C:\apache\htdocs\php\setup\index.php:9)
>in C:\apache\htdocs\php\htmlheader.php on line 30
>I also installed php,apache,perl,mysql etc using a program called:
>"PHPtriad" ( an app that installs/configures everything at once)
>Why am I getting that error, can anyone help?
>below is the header.php file I'm having trouble with:

The file below (now cut) is not your problem.

The problem is in lines 1 through 9 of index.php

You see, you *CANNOT* send any data to the browser before calling header()

Look, it's called a "header" for a reason.  It comes at the HEAD (before)
*ANY* HTML, GIF, JPEG, or other data.  Sample output:

Try this:

<?php echo 'foo';?>

Now, upload that to your web-server, and do like this:

telnet yourwebserver.com 80
GET /foo.php HTTP/1.0
Host: yourwebserver.com

Hit return a couple times after that Host line.

See all that crap?

Look at it.

See the stuff *BEFORE* the blank line? Those are "headers"

See the 'foo' after the blank line?  That's the content.

What do you think will happen if you try to do:

Header: blah, blah, blah
Header: blah, blah, blah
Header: blah, blah, blah

Header: blah blah, blah

See how that works?  You can't do that.

That's what you tried to do.

Somewhere in index.php, on line 9, actually, you sent CONTENT to the
browser.  So PHP *had* to send the blank line marking the end of the

Then, you went and tried to send some more headers.

No can do, buckaroo!

The blank line signalling the end of the headers already went out, and PHP
can't suck it back in.

I dunno what you have in line 9 of index.php, but that's where the problem
really is.  Honest.

Like Music?  http://l-i-e.com/artists.htm

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to