title: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in
body: <p>with setting up my automatic donation system for my site I have got everything working except on the last page I get this error. This is for a Garrys Mod server through Steam.</p>
  
  <p>Error: Warning: file_get_contents(<a href="http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=xxxxxxxxxxxxxxxxxxx&amp;steamids=xxxxxxxxxxxxx" rel="nofollow">http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=xxxxxxxxxxxxxxxxxxx&amp;steamids=xxxxxxxxxxxxx</a>) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in /usr/www/angelgaming/public/multiple-rank/inc/page.verify.php on line</p>
  
  <p>Verify.php code:</p>
  
  <pre><code>&lt;?
      include('apikey.php');
      function toid($friendid) {
      if (substr($friendid,-1)%2==0) $server=0; else $server=1;
      $auth=bcsub($friendid,'76561197960265728');
      $auth=bcsub($auth,$server);
      $auth=bcdiv($auth,2);
      return "STEAM_0:".$server.':'.$auth;
      }
      $string = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' . $API_KEY . 'steamids=' . $_COOKIE['communityid']);
      $json_a = json_decode($string,true);
      $steamname = $json_a['response']['players'][0]['personaname'];
      $avatar64 = $json_a['response']['players'][0]['avatarfull']; 
  
  ?&gt;  
  &lt;h4&gt;Verify the information below before you proceed&lt;/h4&gt;
  &lt;div id="verify"&gt;
      &lt;p&gt;&lt;b&gt;&lt;? echo $steamname; ?&gt;&lt;/b&gt;&lt;/p&gt;
      &lt;p&gt;&lt;img id="avatar" src="&lt;? echo $avatar64; ?&gt;" style="border-radius: 8px;" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;h6&gt;Donation Amount: $&lt;? echo RankPrice($_POST["rank"]) . CURRENCY;?&gt;&lt;/h6&gt;&lt;/p&gt;
      &lt;br /&gt;
      &lt;p&gt;
      &lt;form name="_xclick" action="https://www.paypal.com/nz/cgi-bin/webscr" method="post"&gt;
      &lt;input type="hidden" name="cmd" value="_xclick"&gt;
      &lt;input type="hidden" name="business" value="&lt;? echo PAYPAL_EMAIL; ?&gt;"&gt;
      &lt;input type="hidden" name="currency_code" value="&lt;? echo CURRENCY; ?&gt;"&gt;
      &lt;input type="hidden" name="item_name" value="&lt;? echo SERVER_NAME; ?&gt; Donation (&lt;? echo $steamname; ?&gt;)"&gt;
      &lt;input type="hidden" name="item_number" value="&lt;? echo toid($_COOKIE['communityid']) . '#' . $_POST["rank"]; ?&gt;"&gt;
      &lt;input type="hidden" name="amount" value="&lt;? echo RankPrice($_POST["rank"]); ?&gt;"&gt;
      &lt;input role="button" class="btn btn-success" value="Donate" type="submit" alt="Donate to Envidious via PayPal"&gt;
      &lt;a href="" role="button" class="btn btn-danger"&gt;Go Back&lt;/a&gt;&lt;/form&gt;
      &lt;/div&gt;
  </code></pre>