Remote file accessing using fopen

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
varma457
Forum Newbie
Posts: 23
Joined: Sat Jul 11, 2009 2:43 pm

Remote file accessing using fopen

Post by varma457 »

Hi,

I have a problem with reading a secured remote file.I mean for reading a file required username && password..

I tried it this way..

$hange = fopen('http://username:password@www.fragrancen ... 2.txt','rt');

But is showing

failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required

help regarding this problem would be great
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Remote file accessing using fopen

Post by Christopher »

You might need to use cURL to deal with the authentication.
(#10850)
Post Reply