尽管设置了PHP会话仍为空

时间:2016-06-03 16:10:36

标签: php session

在表单提交上,表单操作成功完成,但是当我最终启动会话以将信息传递给“谢谢”页面时,我收到以下错误:

A PHP ERROR WAS ENCOUNTERED
Severity: Notice
Message: Undefined index: store_fullname
Filename: libraries/Functions.php(688) : eval()'d code
Line Number: 38

我正在定义大约12个会话变量。每次输出错误时,错误中的行号都会改变。

这就是我创建会话的方式。我已经仔细检查了`$ store [“name”]是否存在。

session_start(); // start session
$_SESSION["store_fullname"] = $store["name"];

$url = "https://website.com/form/thanks";

header( "Location: $url" );

尝试解决方案:

在“谢谢”页面上开始会话。得到了这个错误。

A PHP ERROR WAS ENCOUNTERED
Severity: Notice
Message: A session had already been started - ignoring session_start()
Filename: libraries/Functions.php(688) : eval()'d code
Line Number: 4

0 个答案:

没有答案