title: Get URL contents from a sign-in site
body: <p>I want to get the source code of a site using PHP, but when I do it comes up empty.  I believe it is because you have to sign in to the site before using it, and the PHP call is not in a signed in session when asking for the contents.  Is this correct? Is there a way to bypass this or send the sign in user and pass by PHP, so the call can be made later?</p>
  
  <p>I also tried logging in via my browser  to the site and then calling my *.php file in my localhost from the same browser, but it didn't work.</p>
  
  <p>This is an example of a required sign-in site where I want to get the source when opening my mailbox. This is the way I would normally get the site contents.  But it comes up empty:</p>
  
  <pre><code>$url = "http://mail.yahoo.com/mc/welcome".$params;
  $pagesource = file_get_contents( $url );
  
  echo $pagesource;
  </code></pre>
  
  <p>This code works if you call it for example, with <code>$url = "http://stackoverflow.com/users/432539/elcool" ;</code>  which is my profile page and is available publicly without needing to sign in.</p>
  
  <p>Any ideas?</p>