Click to See Complete Forum and Search --> : is there really a message error in the header of my website?
lite_ws
10-25-2006, 03:59 AM
Hi,
I had recently a 2 line message error in the top of my php website, and when i reloaded it the page was appeared normally.
And i received a message from somboby else who told me about the error.
Can you tell me if the message is still running, please.
http://www.smartcoyote.com/tutorial2.php
thanks
Znupi
10-25-2006, 04:44 AM
Yeah ... you're probably talking about...
Warning: Cannot modify header information - headers already sent by (output started at /home/content/e/m/p/empuria/html/templates/main.html.php:5) in /home/content/e/m/p/empuria/html/session.php on line 27
...right? You're probably sending a header after sending some output, thus invoking ye old "header injection". Make sure you send any headers before any output. For example:
<?php
// BAD
echo "Hello world";
header("Content-type: text/html");
?>
<?php
// GOOD
header("Content-type: text/html");
echo "Hello";
?>
Aand also...
Hello
<?php
header("Content-type: text/html");
// BAD
?>
<?php
header("Content-type: text/html");
// GOOD
?>
Hello
Hope that was the problem... :)
lite_ws
10-25-2006, 05:43 AM
Thanks,
i have done what you said, is the error is still running?
be carefull you have a dead image on your site in the PHP Scripts page
ray326
10-25-2006, 10:44 PM
Try buffering your output. My gut feel is it has to do with set-cookie headers because it only happens the first time but that may be a bad impression.
Znupi
10-26-2006, 03:28 PM
Yes, it must be a cookie header problem... It didn't happen the second time...
There's no dead image, it's just slow loading... free host....
lite_ws
10-26-2006, 06:41 PM
Yes, it must be a cookie header problem... It didn't happen the second time...
There's no dead image, it's just slow loading... free host....
thanks, The error is fixed, i recreated totally the page.
it's not a free hosting, it's goddady
Znupi
10-27-2006, 02:33 PM
it's not a free hosting, it's goddady
You said there was a dead image on my site... my site is on a free host, not yours :p