我已在header.php
$order_total = $_SESSION['order_total'];
每次登录时都会收到警告信息
注意:未定义的索引:order_total in 第15行的C:\ xampp \ htdocs \ zzz \ frontend \ header.php
一旦我再次访问该页面,该消息就被删除了
答案 0 :(得分:0)
您必须先检查会话
session_start();
if(isset($_SESSION['order_total']) && !empty($_SESSION['order_total'])) {
$order_total = $_SESSION['order_total'];
}else{
$order_total = "session is not set";
}