php - 注意:尝试访问 bool 类型值的数组偏移量
问题描述
您好,当我通过 Steam 连接到我的网站时遇到问题,它给了我错误:
Notice: Trying to access array offset on value of type bool in /var/www/boutique.sky-community.com/index.php on line 67
Notice: Trying to access array offset on value of type bool in /var/www/boutique.sky-community.com/index.php on line 68
Notice: Trying to access array offset on value of type bool in /var/www/boutique.sky-community.com/index.php on line 69
Notice: Trying to access array offset on value of type bool in /var/www/boutique.sky-community.com/index.php on line 70
Notice: Trying to access array offset on value of type bool in /var/www/boutique.sky-community.com/index.php on line 71
这是我的 index.php 的一部分:
if (!isset($_SESSION['gex_steamid64'])) {
if (isset($_COOKIE['gex_loginsession'])) {
$db->where('session', $_COOKIE['gex_loginsession']);
$db->where('expires > NOW()');
$steamid64 = $db->getValue('sessions', 'steamid64');
if ($db->count) {
$db->where('session', $_COOKIE['gex_loginsession']);
$db->update('sessions', array('expires' => $db->func('DATE_ADD(NOW(), INTERVAL ? DAY)', array(30))));
$_SESSION['gex_steamid64'] = $steamid64;
setcookie('gex_loginsession', $_COOKIE['gex_loginsession'], time() + 2592000, '/');
}
}
} elseif (isset($_GET['login_started'])) {
$steamprofile = SteamAPI::GetUserData($_SESSION['gex_steamid64']);
$steamid32 = $steamprofile['steamid32'];
$nick = $steamprofile['personaname'];
$avatar_small = $steamprofile['avatar'];
$avatar_medium = $steamprofile['avatarmedium'];
$avatar_large = $steamprofile['avatarfull'];
$db->where('steamid64', $_SESSION['gex_steamid64']);
$userdata = $db->getOne('users');
$ip = GetClientIP();
$ips = array($ip);
if ($db->count) {
$sessionkey = hash('sha512', random_string(25).$userdata['random']); //(hash("sha256", md5('Ew97f9N3vq4' . $_SESSION['gex_steamid64'] . '86V' . $result['email'] . 'b93z7' . $_SERVER['HTTP_USER_AGENT'] . '4E$HSJH8gjsA' . $result['random'] . '3oikjfA')));
setcookie('gex_loginsession', $sessionkey, time() + 2592000, '/');
它只有在您登录并且无法正常工作时才完成,有人可以帮助我吗?
解决方案
推荐阅读
- unity3d - How to access a Unity's TextMesh Pro Dropdown component via code?
- python-3.x - 此密码检查程序的终止开关
- python - 递归编程迷宫解决方案
- xcode - 如何删除 iOS 模拟器的首选项
- javascript - 最高分词
- php - 如何使用 CodeIgniter 从 result_array() 中删除一行
- php - Update an ID after getting it with GET
- javascript - Question about setTimeout that I need answer to
- ios - 需要 UI 输入的单元测试?
- c# - better way to write this list[2] as it throws exception