Entry
How do I retrieve pasword protected area with PHP?
Dec 3rd, 2004 08:51
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:$protected_passwd@$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