|
发表于 2011-1-11 14:37:26
|
显示全部楼层
回复 43# lvxuezh
我也出现了类似的错误:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Session:userdata
Filename: controllers/main.php
Line Number: 97
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Session:userdata
Filename: controllers/main.php
Line Number: 98
分别对应的源代码是
function ask()
{
print_r($_SESSION);
if ($this->input->post('search'))
{
$this->session->set_userdata('search', $this->input->post('search'));
}
if ($this->session->userdata('logged_in'))
{
$data['user_name'] = $this->session->userdata['user_name']; //97行
$data['user_level'] = $this->session->userdata['user_level']; //98行
$data['search'] = $this->session->userdata('search');
$this->load->view('top');
$this->load->view('main/main_ask.php', $data);
$this->load->view('bottom');
}else{
redirect('main/login');
}
} |
|