Chinaunix

标题: 关于PHP的疑难杂正!-----请高手帮忙!(在线等) [打印本页]

作者: yocc    时间: 2003-03-26 13:44
标题: 关于PHP的疑难杂正!-----请高手帮忙!(在线等)
<?
        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&amp;threadid=54597&amp;s=e8d071d6c.....
显示的是?s=.......而不是?PHPSESSID=.........呢?
3.有没有好的原代码可供参考?

谢谢!
作者: yocc    时间: 2003-03-28 01:01
标题: 关于PHP的疑难杂正!-----请高手帮忙!(在线等)
着急!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2