Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 更新后蒸汽身份验证不工作_Php_Api_Steam_Steam Web Api - Fatal编程技术网

Php 更新后蒸汽身份验证不工作

Php 更新后蒸汽身份验证不工作,php,api,steam,steam-web-api,Php,Api,Steam,Steam Web Api,蒸汽身份验证在更新后不工作。有什么问题吗? 这是我的代码: $url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".$steamauth['apikey']."&steamids=".$matches[1].""; if (isset($_GET['login'])){ require 'openid.php'; try { require 'Steam

蒸汽身份验证在更新后不工作。有什么问题吗? 这是我的代码:

$url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".$steamauth['apikey']."&steamids=".$matches[1]."";

if (isset($_GET['login'])){
    require 'openid.php';
    try {
        require 'SteamConfig.php';
        $openid = new LightOpenID($steamauth['domainname']);

        if(!$openid->mode) {
            $openid->identity = 'http://steamcommunity.com/openid';
            header('Location: ' . $openid->authUrl());
        } elseif ($openid->mode == 'cancel') {
            echo 'Klaida...';
        } else {
            if($openid->validate()) {
                $id = $openid->identity;
                $ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/";
                preg_match($ptn, $id, $matches);
                include ('userInfo.php');

                $_SESSION['steamid'] = $matches[1];

                $url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".$steamauth['apikey']."&steamids=".$matches[1]."";
                $json_object= file_get_contents($url);
                $json_decoded = json_decode($json_object);

                foreach ($json_decoded->response->players as $player) {
                    $queryas = $db->prepare("SELECT * FROM users WHERE steamid=:steamid");
                    $queryas->bindParam("steamid", $player->steamid, PDO::PARAM_STR);
                    $queryas->execute();

                    if ($queryas->rowCount() > 0) {
                        $query = $db->prepare("UPDATE users SET name=:name, photo=:photo, profile=:profile, steamid=:steamid WHERE steamid=:steamid");
                        $query->bindParam("name", $player->personaname, PDO::PARAM_STR);
                        $query->bindParam("photo", $player->avatar, PDO::PARAM_STR);
                        $query->bindParam("profile", $player->profileurl, PDO::PARAM_STR);
                        $query->bindParam("steamid", $player->steamid, PDO::PARAM_STR);
                        $query->execute();
                    } else {
                        $query = $db->prepare("INSERT INTO users(name, photo, profile, steamid, balance, email) VALUES (:name, :photo, :profile, :steamid, 0, -)"); // Pridėti vis naujas nulines reikšmes.
                        $query->bindParam("name", $player->personaname, PDO::PARAM_STR);
                        $query->bindParam("photo", $player->avatar, PDO::PARAM_STR);
                        $query->bindParam("profile", $player->profileurl, PDO::PARAM_STR);
                        $query->bindParam("steamid", $player->steamid, PDO::PARAM_STR);
                        $query->execute();
                    }
                }

                if (!headers_sent()) {
                    header('Location: '.$steamauth['loginpage']);
                    exit;
                } else {
                    ?>
                    <script type="text/javascript">
                        window.location.href="<?=$steamauth['loginpage']?>";
                    </script>
                    <noscript>
                        <meta http-equiv="refresh" content="0;url=<?=$steamauth['loginpage']?>" />
                    </noscript>
                    <?php
                    exit;
                }
            } else {
                echo "User is not logged in.\n";
            }
        }
    } catch(ErrorException $e) {
        echo $e->getMessage();
    }
}

错误是什么?您是否尝试添加调试步骤以找出失败的地方?当我尝试连接到我的web时,我只得到与以前相同的视图。只有登录栏,没有其他内容。