标题:关于SESSION的问题-->lmhllr转移
只看楼主
pjwistcc
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-6-18
 问题点数:0 回复次数:1 
关于SESSION的问题-->lmhllr转移

我在php.ini 设置了register_globals=on
session.save_path=d:\session
session.bug_compat_42 = 0
session.bug_compat_warn = 0
在D盘下也建立了session文件夹
但运行时出现以下问题
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

程序如下:
//session1_1.php
<?session_start();
echo"<h3>会话名为:".session_name()."<br>";
echo"会话ID为:".session_id()."<br>";
$a='aa';
$b='bb';
session_register('a');
session_register('b');
$_session['c']="变量CCC";
$_session['d']="dddd";
echo'session1_1.php'
?>
<body>
<A HREF="session1_2.php">session1_2</A>
</body>
</html>

//session1_2.php
<?session_start();
echo"会话名为:".session_name()."<br>";
echo"会话名为:".session_id()."<br>";
echo"a=$a<br>";
echo"d=$d<br>";
echo"session1_2.php<br>";
print_r($_session);
echo"<br>";
$_SESSION=array();
echo"会话变量被删除!"."<br>";
print_r($_SESSION);
?>


最后a和d的值没显示,请高手帮忙看下,晕死我了~~

搜索更多相关主题的帖子: session SESSION lmhllr register globals 
2007-06-21 20:27
lmhllr
Rank: 8Rank: 8
等 级:贵宾
威 望:44
帖 子:1504
专家分:42
注 册:2005-5-12
得分:0 
建议用 $_SESSION[]  注意,大写
2007-06-22 01:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-149339-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.303878 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved