Entry
How do I retrieve pasword protected area with PHP?
Feb 27th, 2008 00:00
dman, Edwin Chan, Aziem Hassan, http://www.ttnr.org
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