PHP中通过 $_SESSION保存session变量,下面的代码简单演示了 $_SESSION的用法
/**
* PHP保存信息到当前Session
*
* @param
* @arrange 512-笔记网: www.512Pic.com
**/
session_start();
print("<html><b>");
$_SESSION["sitename"] = "W3M";
print("A value saved in the session named as sitename.\n");
$_SESSION["MyChoice"] = "red";
print("A value saved in the session named as MyChoice.\n");
echo $_SESSION['sitename']."\n";
echo $_SESSION['MyChoice]."\n";
print("</b></html>\n");
/*** 来自编程之家 jb51.cc(jb51.cc) ***/