我在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的问题-->lmhllr转移