faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

48 of 57 people (84%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How do I retrieve pasword protected area with PHP?

Nov 27th, 2008 10:14
healthy man, dman, Edwin Chan, Aziem Hassan,


Try the following:
<?php
  // declare the protected link details
  $protected_userid = "abc";
  $protected_passwd = "cde";
  $protected_url    = "www.abc.com/protected/"
  // open and dump the url
  $fp=fopen
("http://protected_userid:[email protected]$protected_url","r");
  @header("Content-Type: text/html");
  fpassthru($fp);
  exit;
?>
You may also use CURL, for more information on how to use CURL, visit:
    http://www.php.net/manual/en/ref.curl.php
http://www.healthdothealth.com
http://www.healthxhealth.com
http://www.mesotheliomainmesothelioma.com
http://www.healthfirewall.com
http://www.flathealth.com
http://www.healthbodyguard.com