PHP session传值问题
错误信息<br/><b>Notice</b>:Undefinedindex:idin<b>E:\myhj\apache\htdocs\empManage\common.p...
错误信息<br /><b>Notice</b>: Undefined index: id in <b>E:\myhj\apache\htdocs\empManage\common.php</b> on line <b>22</b><br />
源代码:封装的函数页面1:
function getCookieVal($key){
if(!empty($_COOKIE[$key])){ return "";
}else{ return $_COOKIE[$key];
}
}
页面2:
if (empty($_POST['keep'])){
if (!empty($_COOKIE['id'])){
setCookie("id",$id,time()-100);
}
}else {
setCookie("id",$id,time()+7*24*2*3600);
} 展开
源代码:封装的函数页面1:
function getCookieVal($key){
if(!empty($_COOKIE[$key])){ return "";
}else{ return $_COOKIE[$key];
}
}
页面2:
if (empty($_POST['keep'])){
if (!empty($_COOKIE['id'])){
setCookie("id",$id,time()-100);
}
}else {
setCookie("id",$id,time()+7*24*2*3600);
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询