Welcome Guest, Not a member yet? Register   Sign In
Message Cannot modify header information - headers already sent
#11

[eluser]marciol[/eluser]
I have changed only $config['base_url'] ="http://localhost/ci/";-so what's wrong?
#12

[eluser]JoostV[/eluser]
Have you checked to see if there is white space before the <?php openingtag in line 1?
#13

[eluser]marciol[/eluser]
there is no white space before the <?php openingtag in line 1

<?php if(!defined('BASEPATH'))exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
*/
$config['base_url'] ="http://localhost/ci/";
/*
#14

[eluser]JoostV[/eluser]
Copy a fresh config.php into system/application/config/ and see if you still get an errro message. Edit config.php afterwards.
#15

[eluser]Unknown[/eluser]
got a similar problem:

Quote:Message: Cannot modify header information - headers already sent by (output started at C:\sandbox\ignite\system\application\controllers\blog.php:1)

Filename: helpers/url_helper.php

Line Number: 530

I've checked for whitespace in my blog.php but i don't see any. help?
#16

[eluser]Unknown[/eluser]
[quote author="jsonar" date="1232886631"]got a similar problem:

Quote:Message: Cannot modify header information - headers already sent by (output started at C:\sandbox\ignite\system\application\controllers\blog.php:1)

Filename: helpers/url_helper.php

Line Number: 530

I've checked for whitespace in my blog.php but i don't see any. help?[/quote]

Hi,
I had same problem so I tried change coding of blog.php file
and problem resolved
#17

[eluser]thephpx[/eluser]
Hi guys,

Do not know if it will help or not but I was getting the same kinda error.
<-- CODE START --&gt;
function addlession(){
$this->template->type('back');
$this->template->set('admin');
$this->template->load('top', $page);
$this->template->load('lessonsadd', $page);
$this->template->load('bottom');

if(count($_POST) > 1)
{
//do things.
}
}
<-- CODE END --&gt;

upon posting the values to this same function it was showing "Cannot modify header information - headers already sent by...". Loading the template files after the if statement seems to fixed this problem.

In my case it happened because the header was already sent while parsing the templates, not because of any white-space but yes 99% case it happens because of 1 extra line before &lt;?php or after ?&gt; tag.

So to solve this issue I loaded the templates after the if statement Smile

<-- CODE START --&gt;
function addlession(){
$this->template->type('back');
$this->template->set('admin');

if(count($_POST) > 1)
{
//do things.
}
$this->template->load('top', $page);
$this->template->load('lessonsadd', $page);
$this->template->load('bottom');
}
<-- CODE END --&gt;

take care,

faisal
#18

[eluser]Unknown[/eluser]
Hi,

I had similar problem and I would like to share info on my case Smile

I was trying to implement JSON reply with CodeIgniter but when I try to change the headers using "header("content-type:application/json")";, I got the following unexpected response.

Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\filemoo\system\application\controllers\vote.php:1)

Filename: controllers/vote.php

Line Number: 21

I then change the file encoding from UTF-8 to ANSI using Notepad++, a free text editor. And the error was gone Smile

But since I am in Asian countries, I do need UTF-8 support. So I changed the encoding from UTF-8 to UTF-8 without BOM. And then everything is going as expected. The BOM (Byte-order mask) at the beginning of UTF-8 file maybe the culprit.
#19

[eluser]Unknown[/eluser]
Some of CodeIgniter Core files are in UTF-8 encoding. Covert all of your (and CI) files to UTF-8 without BOM, like m3rLinEz says...Notepad++ come in hand, at all. The people that uses Dreamweaver, for example, can get some problems with encoding. Then, convert all files before the tests or deployment.
#20

[eluser]peroperje[/eluser]
thanks man...you help me too




Theme © iAndrew 2016 - Forum software by © MyBB