一个session在页面之间的传递问题,还请各位仁兄帮忙指点一下。
1.php如下:
<?php
if (!isset($_SESSION)) {
session_start();
}
$_SESSION["swhowimg"] = "allen";
?>
2.php如下:
<?php
if (!isset($_SESSION)) {
session_start();
}
print $_SESSION["swhowimg"];
?>
先打开1.php显示值allen,后打开2.php却
提示错误:
Notice: Undefined index: swhowimg in D:\site\dianphp\agent\2.php on line 6
PHP Notice: Undefined index: swhowimg in D:\site\dianphp\agent\2.php on line 6
还请各位帮小弟看看,是不是php环境哪配好?