Home  >  Article  >  Backend Development  >  超链接之后的会话变量访问解决办法

超链接之后的会话变量访问解决办法

WBOY
WBOYOriginal
2016-06-13 10:46:32795browse

超链接之后的会话变量访问
test2.php:
session_start();

if(!isset($_session['card']))
echo "die";
$_session['card']="123";
?>


测试网页2



echo $_session['card'];
?>

3






test3.php:
session_start();
echo $_session['card'];
?>
为什么超链接之后会话变量就不能访问了?

------解决方案--------------------
$_SESSION['card']="123"; //大写

test3.php:
session_start();
echo $_SESSION['card'];
?>

------解决方案--------------------
哪里不行?test2.php 页面输出 123 了吗?
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn