判断是否能登录
<?php
$ret=mysqli_query($conn,$sql);
$row=mysqli_fetch_array($ret);
if(($id==$row["idtop"])&&($user_password==$row["userpassword"])){
setcookie("id",$id,time()+600,'/');
setcookie("password",$password,time()+600,'/');
echo '<script language=javascript>window.location.href="../登录页面.php"</script>';
}else{
echo "登录失败";
}
mysqli_close($conn);
?>
然后想获取cookie值,却没有
<h1?>欢迎你:</h1><?php $_COOKIE["id"];?> <br>