Note that there are some explanatory texts on larger screens.

plurals
  1. POJSON PHP Can't call value from Steam URL
    primarykey
    data
    text
    <p>I'm trying to create a website with Steam's login, but when I try to call a value from JSON, it doesn't work. Everything works in the source code, except for getting the JSON value. I've even tried printing the steam ID, so I know that ID works. The URL works also.</p> <p>Here's <a href="http://pastebin.com/td4CdvQU" rel="nofollow">my source code</a>:</p> <pre><code>&lt;?php require 'openid.php'; try { $openid = new LightOpenID('workinganonymouswebsite.com'); if (!$openid-&gt;mode) { $openid-&gt;identity = 'http://steamcommunity.com/openid'; header('Location: ' . $openid-&gt;authUrl()); } elseif ($openid-&gt;mode == 'cancel') { echo 'User has canceled authentication!'; } else { $steamurl = ($openid-&gt;validate() ? $openid-&gt;identity . '' : 'error'); if ($steamurl == 'error') { print "There was an error signing in."; } else { $id = end(explode('/', $steamurl)); $jsonurl = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=XXXXXXXXXXXXXXXXXX&amp;steamids=" . $id . "&amp;format=json"; $json = file_get_contents($jsonurl, 0, null, null); $json_output = json_decode($json); echo $json_output['players']['personaname']; } } } catch (ErrorException $e) { echo $e-&gt;getMessage(); } ?&gt; </code></pre> <p>Here's the JSON on the website.</p> <pre><code>{ "response": { "players": [ { "steamid": "76561198049205920", "communityvisibilitystate": 3, "profilestate": 1, "personaname": "baseman101", "lastlogoff": 1357603378, "profileurl": "http://steamcommunity.com/id/baseman101/", "avatar": "http://media.steampowered.com/steamcommunity/public/images/avatars/24/24bb7c0505db7efe1f1a602d09a5ea412e0ab4bd.jpg", "avatarmedium": "http://media.steampowered.com/steamcommunity/public/images/avatars/24/24bb7c0505db7efe1f1a602d09a5ea412e0ab4bd_medium.jpg", "avatarfull": "http://media.steampowered.com/steamcommunity/public/images/avatars/24/24bb7c0505db7efe1f1a602d09a5ea412e0ab4bd_full.jpg", "personastate": 1, "primaryclanid": "103582791429521408", "timecreated": 1316469294, "loccountrycode": "US", "locstatecode": "VA", "loccityid": 3918 } ] } } </code></pre> <p>I've tried googling everything. I'm sorry if there is something I missed.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload