miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | 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 Anonymous
Guest
#16 | Posted: 13 Sep 2005 21:44 
Thanks !! :)

Author olega
Guest
#17 | 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
#18 | 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-)
#19 | 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 number in your file.

Author Stryda
Guest
#20 | 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 
#21 | Posted: 14 Mar 2007 04:52 
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
#22 | Posted: 14 Mar 2007 13:04 
It's extremely helpful!!!

Author STRYDA
Guest
#23 | 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
Partaker
#24 | Posted: 19 May 2008 14:04 
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 
#25 | 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
Partaker
#26 | Posted: 26 Oct 2009 08:16 
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 
#27 | 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
Partaker
#28 | 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..

Author Paul
Lead Developer 
#29 | Posted: 27 Oct 2009 06:16 
Danny2000
It's UTF-8 signature.

In this message above it's widely explained how to remove it and what it causes.

Note: we talk about Notepad2 program. Not about default Windows' Notepad, which always produces this flaw!

Author murugan
Partaker
#30 | Posted: 10 Jul 2013 15:18 
Hi Friends.,
i also getting the same problem.i am using php 5.3.13 version..but locally i am not get this error.but my test side i got this error..

Warning: Cannot modify header information - headers already sent byin line ***on line..

please help me..

Thanks in Advance............

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.
 Share Topic's Link

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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑