<?
session_start();
if(!isset($_SESSION['admin'])){
//验证是否设置了cookie
if(isset($_COOKIE['admin_id'])){
$sql="select * from where user_id=1";
include 'includes/db.class.php';
$db=new db('localhost','ecshop_test','root','');
$row=$db->getRow($sql);
$password=$row['password'];
if($password!=$_COOKIE['admin_pass']){
header ('Location:privilege.php');
}
}else{
header('Location:privilege.php');
}
}
?>
session_start();
if(!isset($_SESSION['admin'])){
//验证是否设置了cookie
if(isset($_COOKIE['admin_id'])){
$sql="select * from where user_id=1";
include 'includes/db.class.php';
$db=new db('localhost','ecshop_test','root','');
$row=$db->getRow($sql);
$password=$row['password'];
if($password!=$_COOKIE['admin_pass']){
header ('Location:privilege.php');
}
}else{
header('Location:privilege.php');
}
}
?>