关于php中的session运行不了的问题
程序代码如下:<?phpsession_start();session_register("A");session_register("B");$_SESSION="50...
程序代码如下:
<?php
session_start();
session_register("A");
session_register("B");
$_SESSION="50";
$_SESSION="good luck to";
?>
<html>
<title>session测试</title>
<body>
<?php
echo "session ID = ".session_id()."<br>";
echo "运算前";
echo "session_A=".$_SESSION['A']."<br>";
echo "session_B=".$_SESSION['B']."<br>";
$_SESSION['A'] += 10;
$_SESSION['B'] = "you.";
echo "运算后,将传递至 s02.php<br>";
echo "session_A=".$_SESSION['A']."<br>";
echo "session_B=".$_SESSION['B'];
?>
</body>
</html>
运行后得出的结果是:
session ID =
fc5c39a5d23b463a4d845eb3b4c20c02
运算前session_A=g
session_B=g
Fatal
error: Cannot use assign-op operators with overloaded objects nor string
offsets in E:\AppServ\www\session\s01.php on line 17
请问是哪出了错呢? 展开
<?php
session_start();
session_register("A");
session_register("B");
$_SESSION="50";
$_SESSION="good luck to";
?>
<html>
<title>session测试</title>
<body>
<?php
echo "session ID = ".session_id()."<br>";
echo "运算前";
echo "session_A=".$_SESSION['A']."<br>";
echo "session_B=".$_SESSION['B']."<br>";
$_SESSION['A'] += 10;
$_SESSION['B'] = "you.";
echo "运算后,将传递至 s02.php<br>";
echo "session_A=".$_SESSION['A']."<br>";
echo "session_B=".$_SESSION['B'];
?>
</body>
</html>
运行后得出的结果是:
session ID =
fc5c39a5d23b463a4d845eb3b4c20c02
运算前session_A=g
session_B=g
Fatal
error: Cannot use assign-op operators with overloaded objects nor string
offsets in E:\AppServ\www\session\s01.php on line 17
请问是哪出了错呢? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询