Check out the documentation:
http://www.php.net/manual/en/function.fread.php
Take a look at the last user entered comment:
"If $filename is an URL, you can't use the filesize() function. just put a constant value, and the fread() function will work"
I ran the following:
<?php
$fp = fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml", "r");
$content = fread($fp,1000000);
fclose($fp);
echo $content;
?>
...and it worked just fine.
Jay wrote:
hello-
I'm trying to use the fopen() command to open the url below and just read it
into another $var. However, I'm having some problems.... the warning i get
is below along with the url in the warning. Anyone know what's going on
here??
Thanks,
jay
/ code i'm using: /
$fp = fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml", "r");
$length = filesize($fp);
$content = fread($fp,$length);
fclose($fp);
echo $content;
/ warnings i'm getting /
Warning: php_hostconnect: connect failed
Warning:
fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml"
,"r") - Bad file descriptor