title: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in
body: <p>file_get_contents gives this error:</p>
  
  <pre><code>Warning: file_get_contents(https://graph.facebook.com/oauth/access_token?client_id=&amp;client_secret=fe9f106b05f6ab737a67ccc94a782767&amp;grant_type=client_credentials) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/filevanc/public_html/scripts/cpa/facebookvirallink.php on line 25
  </code></pre>
  
  <p>Here is line 25:</p>
  
  <pre><code> $cred = file_get_contents("https://graph.facebook.com/oauth/access_token?client_id=$appID&amp;client_secret=$secret&amp;grant_type=client_credentials");
  </code></pre>
  
  <p>I have also tried using a different approach to file_get_contents like so:</p>
  
  <pre><code>$opts = array('http'=&gt;array('header' =&gt; "User-Agent:MyAgent/1.0\r\n"));
  $context = stream_context_create($opts);
  $response = file_get_contents($domain,false,$context);
  </code></pre>
  
  <p>But this gives the same error. </p>
  
  <p>Any advice on what else I can try?</p>