Re: Re: How to get PHP to download web contents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> 20030703233946.58370.qmail@web41505.mail.yahoo.com">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/';
> 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/';
> $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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux