title: How to fix php Warning: file_get_contents?failed to open stream: HTTP request failed
body: <p>How to fix php Warning: file_get_contents?</p>
  
  <pre><code>Warning: file_get_contents(http://192.168.1.254:9999/api/p/internal/ucenter/login?loginName=test102&amp;password=111111) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /Applications/XAMPP/xamppfiles/htdocs/PHP_test/index.php on line 49
  </code></pre>
  
  <p>Here is code related to $files:</p>
  
  <pre><code>&lt;?php
  $loginNames="test102";
  $passwords="111111";
  $apiUrl = "http://192.168.1.254:9999/api/p/internal/ucenter/login?loginName=".$loginNames."&amp;password=".$passwords;
  $callback = file_get_contents($apiUrl);
  
  print_r($callback);
  //echo $callback;
  ?&gt;
  </code></pre>