- 论坛徽章:
- 0
|
<?
session_start();
session_register("aUser","aAccount" ;
$aUser = "Cidnie";
$aAccount = "1016";
?>;
<html>;
<head>;
<title>;3.php</title>;
</head>;
<body>;
<?
echo "The user name is:".$aUser."<br>;";
echo "The password is:".$aAccount."<br>;";
?>;
<br>;<br>;
<form action="session_2.php" method="post">;
<a href="session_2.php">; go to page 2 </a>;
</form>;
</body>;
</html>;
*************************
<?
session_start();
?>;
<html>;
<head>;
<title>;3.php</title>;
</head>;
<body>;
<?
echo $aUser;
echo "Current User:".$aUser."<br>;";
echo "Current Account:".$aUser."<br>;";
?>;
</body>;
</html>;
**************************
浏览器显示报告如下 session_1.php)
The user name is:Cidnie
The password is:1016
go to page 2
Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
(session_2.php)只显示
The user name is:
The password is:
没有session_1.php建立会话中传递过来的变量.但是在/tmp中有会话ID,内容是aUser|s:6:"Cidnie";aAccount|s:4:"1016";
问题:1.为什么不能传递会话ID?
2.还有如何能象本论坛的会话http://www.linuxeden.com/forum/newreply.php?action=newreply&threadid=54597&s=e8d071d6c.....
显示的是?s=.......而不是?PHPSESSID=.........呢?
3.有没有好的原代码可供参考?
谢谢! |
|