|
|
|
|
复制本帖HTML代码
|
高亮:
今天贴
X 昨天贴
X 前天贴
X |
seRGDemo1.php //第一页
<?
session_start();
session_register("a", "b", "c");
$a = "A";
$b = "B";
$c = "C";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body background="../images/bac.gif" topmargin=0 id="bac1">
register session:<br>
a="A"<br>
b="B"<br>
c="C"<br><br>
<a href="seRGDemo2.php">Page2</a>
</body>
</html>
seRGDemo2.php //第二页
<?
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body background="../images/bac.gif" topmargin=0 id="bac1">
<?
echo "Show session:";
echo "<br>";
echo $a;
echo "<br>";
echo $b;
echo "<br>";
echo $c;
?>
<br>
<a href="seRGDemo3.php">Page3</a>
</body>
</html>
seRGDemo3.php //第三页
<?
session_start();
session_unregister("a");
//session_destroy();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body background="../images/bac.gif" topmargin=0 id="bac1">
unregister $a;
<br>
<a href="seRGDemo2.php">Page2</a>
</body>
</html>
当我执行完第一页后我可以在相应的文件夹里找到Session function创建的文件, 但当我访问第二页时, Variables 是读不到的. 请问为什么?
.
|
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法! |
|
|