Re: Re: file_get_contents
| From: | Richard Lynch | Date: | Wed, 07 Feb 2007 03:50:02 +0000 |
| Subject: | Re: Re: file_get_contents | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248472@lists.php.net to get a copy of this message | ||
On Tue, February 6, 2007 7:53 am, Colin Guthrie wrote:
> Steven Macintyre wrote:
>> Hiya,
>>
>> I need to be able to read a file into a string - I have used the
>> above
>> command and it works ... now ... I need to read a file into a string
>> - that
>> requires a username and password to access the authentication is
>> normal HTTP
>> basic realm
>>
>> Any ideas?
>
> $var =
>
> file_get_contents('http://username:password@www.example.com/path/to/secret/file.txt');
>
> This is standard web syntax - e.g. it will work in a web browser,
> wget,
> curl, etc.
Actually, IE is dropping (has dropped?) support for the
username:password part because their users are too dumb to chop out
their password before posting their URL or something...
I found this in some KB article somewhere, I think...
They didn't actually express it as user stupidity, mind you. :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?