News:

Join the Facebook Fan Page.

Main Menu

PHP Error

Started by Vinoth, August 03, 2004, 10:14:31 AM

Previous topic - Next topic

Vinoth

Warning: Cannot modify header information - headers already sent by (output started at /home/webhosts/public_html/Index/look.php:4) in /home/webhosts/public_html/Index/look.php on line 40


What does this warning mean?? and can i overcome it.
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

kegobeer

There could be a number of things causing it.  Check for extra carriage returns after ?>.  A google search for "Warning: Cannot modify header information - headers already sent by" should give you more help if that doesn't solve your problem.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Ben_S

It means what it says, you are trying to send HTTP headers out on line 40 of look.php but headers being headers have to come before any other output and you are sending output to the browser on line 4, like it says.
Liverpool FC Forum with 14 million+ posts.

Tomer

Check if you are using any header() functions after output.

z3r0_un0

Quote from: Tomer Dean on August 03, 2004, 12:04:01 PM
Check if you are using any header() functions after output.

Yes, check if you're using header() functions.

If you're doing it, you must put it in the first line of the document, before starts the html.

Tomer

Quote from: z3r0_un0 on August 03, 2004, 05:37:45 PM
Quote from: Tomer Dean on August 03, 2004, 12:04:01 PM
Check if you are using any header() functions after output.

Yes, check if you're using header() functions.

If you're doing it, you must put it in the first line of the document, before starts the html.

It doesnt have to be on the first line, just before output.

z3r0_un0

Quote from: Tomer Dean on August 03, 2004, 05:43:42 PM
It doesnt have to be on the first line, just before output.

I say it, because the header() function have to be before of head tag (<head>).

[Unknown]

Quote from: z3r0_un0 on August 04, 2004, 05:33:59 PM
Quote from: Tomer Dean on August 03, 2004, 05:43:42 PM
It doesnt have to be on the first line, just before output.

I say it, because the header() function have to be before of head tag (<head>).

Not specifically; rather, the header() function cannot be called before anything is output.  For example:

<html>
<?php header('Test: test!!'); ?>


Would not work.  This, however, would:

<?php header('Test: test!!'); ?>
<html>


Or this:
<?php ob_start(); ?>
<html>
<?php header('Test: test!!'); ?>


But, it's not the <html> or <head> element's fault; it's any output:

Text.
<?php header('Test: test!!'); ?>
That would also generate an error.


-[Unknown]

Vinoth

Thanx for the help , all.
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

Advertisement: