在判断session和cookie中的adminId是否为空之前,应该先判断是否设置了该cookie/session.如下:
if ((!isset($_SESSION['adminId']) || $_SESSION['adminId']=="")
&& (!isset($_COOKIE['adminId']) || $_COOKIE['adminId']=="")){
alertMsg("请先登录", "login.php");
}
if ((!isset($_SESSION['adminId']) || $_SESSION['adminId']=="")
&& (!isset($_COOKIE['adminId']) || $_COOKIE['adminId']=="")){
alertMsg("请先登录", "login.php");
}
2015-08-19
function insert($link,$table, $array)里面的sql语句错了,应该是$sql="insert into {$table}($keys) values ({$vals})";bug调了好久
2015-08-18