注意:尝试访问 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,'/');

只有在您登录时才完成,但无法正常工作,有人可以帮助我吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)