switch ($p) { case 'login': include 'openid.php'; try { $openid = new LightOpenID('http://'.$_SERVER['SERVER_NAME'].'/'); if (!$openid->mode) { $openid->identity = 'http://steamcommunity.com/openid/?l=russian'; header('Location: ' . $openid->authUrl()); } elseif ($openid->mode == 'cancel') { echo ''; } else { if ($openid->validate()) { $id = $openid->identity; $ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/"; preg_match($ptn, $id, $matches); $url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=E7AE7AAE3CB43A2A642C855ACA4FE117&steamids=$matches[1]"; $json_object = file_get_contents($url); $json_decoded = json_decode($json_object); die($url); foreach ($json_decoded->response->players as $player) { $steamid = $player->steamid; $name = $player->personaname; $avatar = $player->avatarfull; } } } } catch (ErrorException $e) { exit($e->getMessage()); } break; default: header('location: /main'); exit(); break; } $json_object = file_get_contents($url); - gives an empty result.
Checked so, after the line $json_object = file_get_contents($url); put die($json_object) - the result is an empty page, $url is transmitted and displayed normally.
http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=E7AE7AAE3CB43A2A642C855ACA4FE117&steamids=76561198222889260 here is a valid $url .
How to get rid and find out what exactly the problem is? I'm suffering the second day