会话变量不显示在另一个页面中 [英] Session variable not displayed in another page
本文介绍了会话变量不显示在另一个页面中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在menu.php中使用了两个网页,但我无法获得会话变量的详细信息,它将显示未定义的索引。
controller.php
$ info = mysql_fetch_array($ data);
session_start();
//存储会话数据
$ type =$ info [TYPE];
$ no =$ info [NO];
$ _SESSION ['type'] = $ type;
$ _SESSION ['no'] = $ no;
回显Pageviews =。 $ _SESSION [类型];
回显Pageviews =。 $ _SESSION [否];
header('Location:menu.php');
menu.php
<?php sesstion_start();
回显Pageviews =。 $ _SESSION [类型];
回显Pageviews =。 $ _SESSION [否];
?>
解决方案
sesstion_start();
看到这里有什么不对吗? :P
i am using two webpage in menu.php i am not able to get the detail of session variable it will display undefined index.
controller.php
$info = mysql_fetch_array( $data );
session_start();
// store session data
$type="$info[TYPE]";
$no="$info[NO]";
$_SESSION['type']=$type;
$_SESSION['no']=$no;
echo "Pageviews=". $_SESSION['type'];
echo "Pageviews=". $_SESSION['no'];
header('Location:menu.php');
menu.php
<?php sesstion_start();
echo "Pageviews=". $_SESSION['type'];
echo "Pageviews=". $_SESSION['no'];
?>
解决方案
sesstion_start();
See anything wrong in here? :P
这篇关于会话变量不显示在另一个页面中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文