用户信息 session_start();
function p($arr){
echo "
"; <br>print_r($arr); <br>echo "
";
}
p($_SESSION);
p($_COOKIE);
?>
function p($arr){
echo "
"; <br>print_r($arr); <br>echo "
";
}
session_start();
//p($_POST);
$_SESSION['username'] = $_POST['username'];
$_SESSION['password'] = $_POST['password'];
if($_POST['jizhu']){
setcookie('username',$_POST['username'],time()+60);
setcookie('password',$_POST['password'],time()+60);
}
header("location:form.php");
session_start();
echo "先关闭浏览器,在访问form.php 试试,然后 点推出在关闭浏览器试试";
p($_SESSION);
p($_COOKIE);
if(empty($_SESSION['username'])){
if(empty($_COOKIE['username'])){
echo "
请先登录";exit;
}else{
$_SESSION['username'] = $_COOKIE['username'];
}
}
function p($arr){
echo "
"; <br>print_r($arr); <br>echo "
";
}
?>
2131231231
修改信息 推出