Welcome Guest, Not a member yet? Register   Sign In
Error Line number 662 library/session.php

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at Z:\home\mysite\system\application\controllers\welcome.php:48)

Filename: libraries/Session.php

Line Number: 662

In some page of the site there is an error on the top - what does it mean?

Which CI version are you using?
Post the code of your controller / view.
Do you have white spaces at the end of your controllers?
Omit the closing ?> tag.
Do you echo from within the controllers?


class Welcome extends Controller {

    function Welcome()

function index(){
  $data['title'] = "Welcome to our Site";
  $data['headline'] = "Welcome!";
  $data['include'] = 'home';

function contactus(){

function thankyou(){
  $data['title'] = "Thank You!";
  $data['headline'] = "Thanks!";
  $data['include'] = 'thanks';

function contact(){
  if ($this->input->post('email')){


header.php view
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">&lt;html &gt;

&lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"/&gt;
&lt;meta name="description" content="description"/&gt;
&lt;meta name="keywords" content="keywords"/&gt; &lt;link rel="stylesheet" type="text/css" href="&lt;?=base_url()?&gt;public/css/style.css" media="screen"/&gt;
&lt;title&gt;День Рождения Алины Шиповой!!!&lt;/title&gt;


<div class="outer-container">
<div class="header">

template.php view
<p>This is random text for the CodeIgniter article.
There's nothing to see here folks, just move along!</p>
<h2>Contact Us</h2>

echo form_open('welcome/contactus');
echo form_label('your name','name');
$ndata = array('name' => 'name', 'id' => 'id', 'size' => '25');
echo form_input($ndata);

echo form_label('your email','email');
$edata = array('name' => 'email', 'id' => 'email', 'size' => '25');
echo form_input($edata);

echo form_label('how can you help you?','text');
$cdata = array('name' => 'text', 'id' => 'text', 'cols' => '40', 'rows' => '5');
echo form_textarea($cdata);

echo form_submit('submit','send us a note');
echo form_close();


You didn't answer all of my questions:
Quote:Which CI version are you using?
Do you have white spaces at the end of your controllers?

Try omitting the closing ?&gt; tag!

Read through these treads:
- http://ellislab.com/forums/viewthread/45181/
- http://ellislab.com/forums/viewthread/69280/

Does the error occur when you call any function of your welcome controller or ist it function specific?

In the error message the session class is mentioned, but you are not using it in your controller, did you load it somewhere else?

Omitting the closing ?&gt; tag helps to exclude this problem! my CI is 1.7
But I don't understand how it works

Read through this: http://www.bigbluehat.com/blog/2009/02/1...hitespace/

two things,
check your File Encoding type and if your welcome.php is UTF-8 BOM save without BOM.

BTW, check your welcome.php end of file and maybe there is same space after '?&gt;' tag, end if yes delete them then try again.

Theme © iAndrew 2016 - Forum software by © MyBB