opening htaccess-protected remote files

[email protected] (Michael Schüller)
Newsgroups php.general
Message-ID <[email protected]>
Hi,

I tried to open (and read) htaccess-protected files with 1.file() and
2.fread() like this:

1.
$url = "http://user:[email protected]";
$string = implode("\n", file($url)); 

2.
$url = "http://user:[email protected]";
$fd = fopen ($url, "r");
$contents = fread ($fd, 1000000);
fclose ($fd);

Both give me "unknown error".
Can anybody help?

Michael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.