title: Retrieve username, password parameters passed through curl
body: <p>I am trying to send username and password parameters to a url using curl, and I want to retrieve them. I send the parameters to a page, like the following:</p>
  
  <pre><code>&lt;?php
  
  $curl = curl_init('http://localhost/sample.php');
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);                         
  curl_setopt($curl, CURLOPT_USERPWD, 'key:123456');
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);                    
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);                          
  curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);                           
  curl_setopt($curl, CURLOPT_USERAGENT, 'Sample Code');
  
  $response = curl_exec($curl);                                          
  $resultStatus = curl_getinfo($curl);                                   
  
  if($resultStatus['http_code'] == 200) {
      echo $response;
  } else {
      echo 'Call Failed '.print_r($resultStatus);                         
  }
  ?&gt;
  </code></pre>
  
  <p>Now in the sample.php page, how can I retrieve those parameters?
  (here, username is key, password is 123456).</p>
  
  <p>I suppose they must be available in the $_SERVER array, but they are not available.</p>