我有这段代码,但是当我尝试加载页面时它是空白的:(我用 USERCOOKIEID 和 PASSCOOKIEID 替换了 cookie 的实际名称,并删除了用户登录时发生的代码)
if(isset($_COOKIE['USERCOOKIEID'])) {
$user = $_COOKIE['USERCOOKIEID'];
$pass = $_COOKIE['PASSCOOKIEID'];
$check = mysql_query("SELECT * FROM users WHERE username = '$user'")or die();
while($info = mysql_fetch_array($check)) {
if ($pass != $info['password']) {
}else{
//This is were the code goes for a user that is signed on
}
}
}else{//what happens if they don't have the cookie
header("Location: login.php");
}
谢谢