Quote:
Originally Posted by JetLinus
Just got a possible PHP solution:
Code:
$f = fopen("http://blahblah","r");
$text = fread($f, 65535);
fclose($f);
65536 is a buffer in this case.
Also look for class_snoopy, a sort of webbrowser control...
|
yay!!!
It works. Thanks!
I got the page in a variable. I didn't know that fread could read web pages.
BTW, as a sidenote for those who want to use this feature too: if you use fread on a web page it stops reading after it has received a network packet. Use fread in a loop to collect the entire page and not only the first few bytes.
Code:
<?php
$handle = fopen("http://www.example.com/", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
?>
From:
http://www.php.net/manual/en/function.fread.php