一旦用户登录了我的在线商店的帐户(使用 cartweaver 4 php 构建),我试图隐藏一个 div,但我似乎无法让它工作。
用于定义用户是否登录的 php 代码如下:
if(!strlen($_SESSION["cwclient"]["cwCustomerID"]) ||
$_SESSION["cwclient"]["cwCustomerID"] === 0 ||
$_SESSION["cwclient"]["cwCustomerID"] === "0" ||
$_SESSION["cwclient"]["cwCustomerType"] == 0 ||
(isset($_SESSION["cwclient"]["cwCustomerCheckout"]) &&
strtolower($_SESSION["cwclient"]["cwCustomerCheckout"]) == "guest"))
并且我想在登录时隐藏的 div 包含一个表,已被赋予一个 id 和类:
<div id="newcustomertable" class='newcustomer'>
我尝试使用 css 应用此方法:Show Hide div if, if statement is true
但这最终在我的测试服务器上给了我一个未定义的变量错误。
我承认我是一个 php 新手,所以如果任何能够更了解这一点的人都可以提供帮助并可能找到解决方案,我将不胜感激。
谢谢你。