Steve B. wrote:

How would you get PHP to download a file such as a web page and put it in a string?

What keywords would relate to this (besides php download)

I need a user to be able to put in a name and pass and have PHP go to a cetain site.
The site can take the user/pass in the url so I do not need a form submit.
Then I need the site contents to be in a php variable.
Any tips on parsing html out of it would be great.

Thanks


$fp = fopen("/http://site.com/path/to/file/";, "r"); while (!feof($fp)) { $buf .= fread($fp, 1024); } fclose($fp);

I like this method more than using file(), just because I have more control over what happens. Since you're reading as its downloading, you can do stuff with the data before you're finished.

As for parsing HTML... regular expressions are very cool.


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



Reply via email to