Re: Re: How to get PHP to download web contents
| From: | Adam Voigt | Date: | Mon, 07 Jul 2003 14:22:58 +0000 |
| Subject: | Re: Re: How to get PHP to download web contents | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-29127@lists.php.net to get a copy of this message | ||
Try CURL:
http://us2.php.net/curl
On Mon, 2003-07-07 at 10:17, Steve B. wrote:
> Yes I had tried all those below before posting.
> It sounds like this is the only way to deal with authentication from what I see.
> In windows it works fine from the browser to include name and pass in url.
> In Linux it comes back and asks for the pw again.
> I'd think the only difference would be in headers.
> Is there any header info todo with authentication which come from the client which are not set
> by
> doing the url name and pw?
>
> Thanks,
> Steve
>
> --- Ognyan Bankov <ogre@ogre.homelinux.org> wrote:
> > "Steve B." <stylinsty@yahoo.com> wrote in message
> > news:20030703233946.58370.qmail@web41505.mail.yahoo.com...
> > > Hi Nadim,
> > > It works but not for sites with password window that pops up.
> > I see.
> > That is HTTP Basic Authentication
> > You should use this line:
> > $filename = 'http://someuser:somepwd@somesite.com/';P6j ½•¬í
> > ¦ïŸ½‘
> > instead of:
> > $filename =
> > "http://somesite.com?user=someuser&pwd=somepwd;
> >
> > and source will look like:
> > <?php
> > // get contents of a file into a string
> > $filename = 'http://someuser:somepwd@somesite.com/';Â`C=1
> > êVá”çÅ’çDÓ
> > $handle = fopen ($filename, "r");
> > $contents = fread ($handle, filesize ($filename));
> > fclose ($handle);
> > ?>
> >
> > nadim's solution will look like this:
> > $html = implode ('', file
> > ('http://someuser:somepwd@somesite.com/'));
> >
> >
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
--
Adam Voigt (adam@cryptocomm.com)
Linux/Unix Network Administrator
The Cryptocomm Group