minibb®
Fight the automated spam - protect your miniBB-forums,
getting the Captcha addon! Click here to read more.
Captcha Addon for miniBB
Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
FAQ miniBB Community Forum / FAQ /

Warning: Cannot modify header information - headers already sent by ... etc.

 Page:  ««  1  2 
Team
8-)
#16 | Posted: 21 Jul 2005 15:50
Reply 
So, there is any another output then. There must be NO OUTPUT in your includes/header.php before the necessary action.
Anonymous
Guest
#17 | Posted: 4 Aug 2005 21:51
Reply 
I got a similar message and cleared it up by looking at the message.

From what I can work out,

"output started at /hsphere/local/home/khitai/khitai.com/includes/header.php:8"

means that you should look at line 8 of the header.php file. Look there and see what is going on.

In my case it was a couple of line breaks but the reson I hadn't noticed before-hand was that they were after the closing ?> tag of the include.
Anonymous
Guest
#18 | Posted: 13 Sep 2005 21:44
Reply 
Thanks !! :)
olega
Guest
#19 | Posted: 16 Sep 2005 22:23
Reply 
So, there is a space, you only don't see it. If you have used Notepad or some another UTF-8 editor, they leave 3 bytes for UTF-8 encoding at the very top of each UTF-8 file. For removing these bytes, you need plain text editor like Metapad, for example. Or try Notepad 2.


Holly smoke it's working with Notepad2!
Just make sure choose right:

from menu: File --> Encoding --> UTF-8,
then File --> Save

Thank you, so much!
Anonymous
Guest
#20 | Posted: 29 Sep 2005 11:01
Reply 
A detailed explanation (with solutions and workarounds) is provided here.
Anonymous
Guest
#21 | Posted: 10 Oct 2005 19:42
Reply 
HEY!, i've benn deleted any space before the <php? and it not worked :(

can you help me?

thanks
Team
8-)
#22 | Posted: 11 Oct 2005 13:18
Reply 
Then the ouput is in another place. PHP provides very complete information on where the output have been started - so just check this line in your file.
Stryda
Guest
#23 | Posted: 10 Mar 2007 13:32
Reply 
Hi i keep gettin this message...

Warning: Cannot modify header information - headers already sent by (output started at e:\webareas\as487\finalproject\insert_advert.php:7) in e:\webareas\as487\finalproject\insert_advert.php on line 23


...everytime i try posting on my website. This is an error for one of the pages i have. Get same error for the other ones jst different files location. I cant see any spcaces or anything PLEASE SOMEONE HELP!!!!

...This is the coding for one of the PHP pages...

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>


<body background="middle.png">
<?php
//open connection to connect to cms server or die if incorrect
$connection = mysql_connect("mysql.cms.gre.ac.uk","*****","*******") or die(mysql_error());
mysql_select_db("mdb_*******", $connection);

//create short variable name
$Aname = $HTTP_POST_VARS['Aname'];
$Adescription = $HTTP_POST_VARS['Adescription'];
$Aprice = $HTTP_POST_VARS['Aprice'];
$Acontact = $HTTP_POST_VARS['Acontact'];
$Adate = $HTTP_POST_VARS['Adate'];

$insert_advert = "insert into Advert values ('','$Aname', '$Adescription', '$Aprice', '$Acontact', '$Adate')";
mysql_query($insert_advert);

//sends php file to aconformation after executing the top code
header("Location: aconformation.php");
?>
</body>
</html>
Paul
CEO
#24 | Posted: 14 Mar 2007 04:52 | Edited by: Paul
Reply 
You should supress any HTML output before you send a header. Having any kind of symbols output before, either it's space or HTML causes this problem...
Anonymous
Guest
#25 | Posted: 14 Mar 2007 13:04
Reply 
It's extremely helpful!!!
STRYDA
Guest
#26 | Posted: 15 Mar 2007 18:24
Reply 
Its ok now ive sorted the problem the data was being sent twice thats why i was gettin the error message, ive changed the "header" to "include" so it works fine now. Thanks anways
xjessie007
Forums Member
#27 | Posted: 19 May 2008 14:04 | Edited by: xjessie007
Reply 
I had a problem with the "headers already sent" too at my www.Maxi-Pedia.com website. In my case, it was caused by a blank line at the beginning of one *.inc file. PHP seems to have problems with extra spaces here and there.

Check all your *.inc files to make sure you do not have closing ?> in any of them. Closing ?> is not needed in your *.inc files. Check all your *.php files to make sure you do not have blank lines at the beginning or at the end.

If you are working in a CMS, then it may be caused by some module, disable your modules one by one to find out which one causes this.

This can also be caused by UTF-8. If you have your website coded in ASCII and are saving your php files as UTF-8, it can cause this message. If your website and DB are UTF-8, you should be ok with saving php files as UTF-8 though.

Btw, this error message is related to output_buffering on/off in your php.ini. If you have output_buffering set to some cache, the server will allow to send headers with delay (or to modify them shortly after they are sent), and this error will not be tripped. But if you set output_buffering to 0 or not at all, then headers can be sent at only one moment, and if you have some bad code, it will trip this error message.
Paul
CEO
#28 | Posted: 20 May 2008 03:30
Reply 
I doubt your advice is absolutely right... closing ?> is needed in any kind of PHP file, it's a syntax tag and I can't believe it causes this error. BUT you can't have additional spaces AFTER this tag.
Guest
#29 | Posted: 16 Nov 2008 13:07
Reply 
Вас увидят в небе!
Реклама на воздушных змеях.
Воздушные змеи для отдыха.
http://at.nsk.ru/
Компания «Авиатехникс» имеет многолетний опыт изготовления высококачественных воздушных змеев.
Мы приглашаем к сотрудничеству Рекламные Агентства и непосредственно организации,
желающие разместить свой логотип на воздушных змеях.
Guest
#30 | Posted: 16 Nov 2008 13:19
Reply 
http://vega.nsk.ru
часы
кварцевые
будильники
настенные часы
производство часов
часовой завод
кварцевые часы
часы с логотипом
часы на заказ
заказные часы
 Page:  ««  1  2 
Your reply
Bold Style  Italic Style  Image Link  URL Link 


» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, be sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
Online now: Guests - 35
Members - 0
Most users ever online: 191 [24 Dec 2007 14:33]
Guests - 191 / Members - 0

Forums are powered by miniBB®