Hi all,
I'm trying to open, read and extract information from a website
(maximum and minimum temps from
http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV10450.txt )... Could
anyone give me some direction in how to do this? Below is the code I
have written but i keep get given an 'invalid stream resource' error
Thanks for any help! :)
Nima
<?php
$page = "www.bom.go v.au/cgi-bin/wrap_fwo.pl?IDV 10450.txt";
$time_limit = 60;
$file = fsockopen($page , $errno, $error, $time_limit);
if(!fp){
echo("Connectio n failure");
}
else
{
fputs($file, "GET / HTTP/1.0\r\n\r\n");
while (!feof($file)){
$data[] = fgets($file, 1000);
}
fclose($file);
}
?>
I'm trying to open, read and extract information from a website
(maximum and minimum temps from
http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV10450.txt )... Could
anyone give me some direction in how to do this? Below is the code I
have written but i keep get given an 'invalid stream resource' error
Thanks for any help! :)
Nima
<?php
$page = "www.bom.go v.au/cgi-bin/wrap_fwo.pl?IDV 10450.txt";
$time_limit = 60;
$file = fsockopen($page , $errno, $error, $time_limit);
if(!fp){
echo("Connectio n failure");
}
else
{
fputs($file, "GET / HTTP/1.0\r\n\r\n");
while (!feof($file)){
$data[] = fgets($file, 1000);
}
fclose($file);
}
?>
Comment