|
function checklogin(){
$wuan_username = htmlspecialchars(trim($this->input->post('username')));
$wuan_password = trim(md5($this->input->post('pwd')));
$remember = $this->input->post('remember');
$user = $this->login_m->check_user($wuan_username,$wuan_password);
if(!empty($user)){
if(!empty($remember)){
setcookie("wuan_username",$wuan_username,time()+7*86400);
setcookie("id",$user[0]['id'],time()+7*86400);
}else{
setcookie("wuan_username",$wuan_username);
setcookie("id",$user[0]['id']);
}
header("location:".base_url('index_c/test'));
}else{
echo "<script>alert('用户名或密码不正确');history.go(-1);</script>";
}
}
只能在当前login的C用,然后跳转到index_c里 COOKIE就用不了了,求大神解决!
|
|