miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
FAQ miniBB Support Forums / FAQ /   

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

Page  Page 2 of 3:  « Previous  1  2  3  Next »  
Author Team
8-)
#16 | Posted: 21 Jul 2005 15:50 
So, there is any another output then. There must be NO OUTPUT in your includes/header.php before the necessary action.

Author Anonymous
Guest
#17 | Posted: 4 Aug 2005 21:51 
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.

Author Anonymous
Guest
#18 | Posted: 13 Sep 2005 21:44 
Thanks !! :)

Author olega
Guest
#19 | Posted: 16 Sep 2005 22:23 
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!

Author Anonymous
Guest
#20 | Posted: 10 Oct 2005 19:42 
HEY!, i've benn deleted any space before the <php? and it not worked :(

can you help me?

thanks

Author Team
8-)
#21 | Posted: 11 Oct 2005 13:18 
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.

Author Stryda
Guest
#22 | Posted: 10 Mar 2007 13:32 
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>

Author Paul
Lead Developer
#23 | Posted: 14 Mar 2007 04:52 | Edited by: Paul 
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...

Author Anonymous
Guest
#24 | Posted: 14 Mar 2007 13:04 
It's extremely helpful!!!

Author STRYDA
Guest
#25 | Posted: 15 Mar 2007 18:24 
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

Author xjessie007
Registered
#26 | Posted: 19 May 2008 14:04 | Edited by: xjessie007 
I had a problem with the "headers already sent" too at my 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.

Author Paul
Lead Developer
#27 | Posted: 20 May 2008 03:30 
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.

Author pasargad
Registered
#28 | Posted: 26 Oct 2009 08:16 | Edited by: pasargad 
Warning: Cannot modify header information - headers already sent by (output started at /home/patomatcc/public_html/forums/setup_options.php:1) in /home/patomatcc/public_html/forums/addon_whosonline.php on line 40


edit addon_whosonline.php and clean space & symbols before <?php and after ?> and save to UTF-8 Encod but dont Resolving Error

plz help me

Author Paul
Lead Developer
#29 | Posted: 26 Oct 2009 12:12 
The error is not under addon_whosonline.php. It's under setup_options.php in your case.

Author Danny2000
Registered
#30 | Posted: 27 Oct 2009 04:58 
pasargad:
plz help me

<?php


----------------------
don't edit your php files with notepad.. try change them with some PHP editor or ftp browsers.
then u don't get this error..
you have to remove this (<?php) before <?php.. it is hidden u can see it in ftp browsers..

Page  Page 2 of 3:  « Previous  1  2  3  Next » 
FAQ miniBB Support Forums / FAQ / Warning: Cannot modify header information - headers already sent by ... etc. Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB