|
本帖最后由 dongfang521 于 2010-5-28 18:12 编辑
注销系统没有反应?
controller:
function logout() {
$this->session->unset_userdata('username');
$this->session->sess_destroy();
redirect("guestbook/index");
}
modfunction login($username,$password) {
$query = $this->db->get_where('admin',array('username'=>$username));
$admin = $query->row();
if ($admin) {
if ($admin->password == $password) {
$newdata = array('username'=> $admin->username);
$this->session->set_userdata($newdata);
return true;
}else {
return false;
}
}else {
return false;
}
}el: |
|