[eluser]Rumel[/eluser]
How can i ignor this error:
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\CodeIgniter\system\application\controllers\basic.php:278)
Filename: libraries/Session.php
Line Number: 662
My controller is:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Basic Extends Controller {
public function Basic()
{
parent::Controller();
//$this->load->library('mySmarty');
$this->load->model('sample1','um');
$this->load->helper(array('form','url'));
$this->load->library('form_validation');
//$this->load->library('securimage');
$this->load->helper('url');
$this->load->helper('html');
$this->load->library('calendar');
$this->load->library('securimage');
$this->load->library('session');
}
function index()
{
//$this->load->model('test','um');
//$data=$this->um->test_table_show();
//$data['sample']=$this->sample->show();
//$this->mysmarty->assign('title',$data);
//$this->mysmarty->assign('content',"Hello!");
//$this->mysmarty->assign('test', 'Hello World.');
//$this->mysmarty->views('blog/sample'$title);
//}
//}
$data['user']=$this->um->show_event_title();
$this->load->view('home',$data);
//$this->mysmarty->display("basic.tpl");
}
function contact()
{
$this->load->view('contact');
}
function event()
{
$this->load->view('Latestevent');
}
function latest_even_title()
{
//$this->load->model('sample1','um');
$data['user']=$this->um->show_event_title();
$this->load->view('home',$data);
//$this->load->model('sample1','um');
//$data['tool']=$this->um->show_event_title();
//$this->load->view('home',$data);
}
function event_insert()
{
$this->um->event_inserts($_POST['title'],$_POST['category'],$_POST['detils']);
}
function contactinsert()
{
$this->form_validation->set_rules('name', 'Username','trim|required|min_length[5]|max_length[12]|xss_clean');
//$this->form_validation->set_rules('password', 'Password', 'trim|required|matches[passconf]|md5');
//$this->form_validation->set_rules('passconf', 'Password Confirmation', 'trim|required');
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('contact');
}
else
{
$this->load->view('contact');
}
$inputCode = $_POST['imagecode'];
if($this->securimage->check($inputCode) == true)
{
$data['result'] = '<h1>=v= PASS!</h1>';
$this->um->contact_insert($_POST['name'],$_POST['email'],$_POST['subject'],$_POST['summary_text']);
//session_destroy();
$this->load->view('contact',$data);
//$this->load->view('templates/basic_insert.tpl',$data);
}
else
{
//echo 'Please retrype the captcha';
$data['result'] = '<h1>/_\ FAILURE</h1>';
//$this->load->view('templates/rumel',$data);
$this->load->view('contact',$data);
}
}
}
?>
model is:
<?php
class Sample1 extends Model{
function Sample1()
{
parent::model();
}
function test_table_show()
{
$query = $this->db->get('book_info_cse');
return $query->result();
}
function show_event_title()
{
//$this->db->select('title');
$query = $this->db->get('latesteven',8);
return $query->result();
}
function event_inserts()
{
$this->title =$_POST['title'];
$this->category=$_POST['category'];
$this->detils=$_POST['detils'];
$this->db->insert('latesteven',$this);
$this->load->view('Latestevent');
}
function delete()
{
$delete=$_POST['delete'];
for($i=0;$i<count($delete);$i++)
{
$this->db->where('id',$delete[$i]);
$this->db->delete('book_info_cse');
}
}
function contact_insert()
{
$this->name =$_POST['name'];
$this->email=$_POST['email'];
$this->subject=$_POST['subject'];
$this->summary=$_POST['summary_text'];
$this->db->insert('contact',$this);
$this->load->view('contact');
}
}
?>
my view page is: <div id="m_bac"><h3>Recent post</h3></div>
<ul>
<?php foreach ($user AS $row)
{
?>
<li ><a href="#"><?=$row->title?></a></li>
<?php
}
?>
</ul>
<div>
<div id="m_bac"><h3>Category</h3></div>
<?php foreach ($user AS $row)
{
?>
<li ><a href="#"><?=$row->category?>()</a></li>
<?php
}
?>
</div>
</div>