<?php
class Member extends CI_Controller
{
public function __construct()
{
parent:: __construct();
}
public function index()
{
$sql = "select * from td_member order by id asc";
$rs= $this->db->query($sql);
$data["rs"] = $rs->result_array();
$this->load->view("member/index",$data);
}
public function add()
{
if($this->input->post("btsave")!=null)
{
$ar=array(
"member_nmae"=>$this->input->post("member_name"),
"member_tel"=>$this->input->post("member_tel"),
"member_address"=>$this->input->post("addr")
);
$this->db->insert("td_member",$ar); redirect('member','refresh');
exit();
}
$this->load->view("member/add");
}
}
แล้วมัน error ว่า
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\CodeIgniter\application\models\guestbook_model.php:1)