<?php
header("content-type:text/html;charset=utf-8");
session_start();
if(isset($_SESSION['name'])){
echo "已经注册了session";
}else{
echo "还没有注册session";
$_SESSION['name'] = 'SESSION名称';
}
if(isset($_SESSION['name'])){
echo "已经注册了session";
echo $_SESSION['name'];
}else{
echo "还没有注册session";
}
?>
header("content-type:text/html;charset=utf-8");
session_start();
if(isset($_SESSION['name'])){
echo "已经注册了session";
}else{
echo "还没有注册session";
$_SESSION['name'] = 'SESSION名称';
}
if(isset($_SESSION['name'])){
echo "已经注册了session";
echo $_SESSION['name'];
}else{
echo "还没有注册session";
}
?>