当前位置:Linux教程 - Php - session的问题

session的问题

1)PHP Version 4.0.6,register_globals = On;

2)page1.php中:
<?
session_start();
session_register ("test1");
session_register ("test2");
$HTTP_SESSION_VARS["test1"] = "1";
$HTTP_SESSION_VARS["test2"] = "2";
echo "A=".sizeof($HTTP_SESSION_VARS);
echo "<html>\n";
echo "<body>\n";
echo "<form name=form_1 method=post action='page2.php'>\n";
echo "<input type=submit value='SUBMIT'>\n";
echo "</body>\n";
echo "</html>\n";
?>
输出显示A=2

3)page2.pho:
<?
session_start();
echo "A=".sizeof($HTTP_SESSION_VARS);
?>
从page1.php点SUBMIT后,显示A=0

4)请问这是�