public static function Getsiteinfo ($domain) {
Self:: $siteInfo = $_cookie["Site"]; if (Empty (self:: $siteInfo) | | self:: $siteInfo ["domain"]! = $domain) {
$sql = "SELECT * from Site_config where domain= ' {$domain} '";
Self:: $siteInfo = Self::queryarray ($sql);
Self::setcookie (self:: $siteInfo, "site");
}
Return self:: $siteInfo;
}
}
The problem is in the Scarlet Letter line. Obviously $_cookie["site" has data, but self:: $siteInfo is always empty. Would you please help me see what the reason is?
------Solution--------------------
How do You know self:: $siteInfo always empty???
You can use $_cookie["site" To assign a value, and then $siteinfo["domain" in a moment.
is $_cookie["Site" or $siteinfo an array? Where does domain come from?
------Solution--------------------
Self:: $siteInfo = $_cookie["Site"];//is this value an array?
if (self:: $siteInfo) | | self:: $siteInfo ["domain"]! = $domain)//You output a value within the condition to see if there is any execution, you know?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.