fopen 'no error' error?
| From: | ryan scott | Date: | Wed, 07 Aug 2002 23:17:59 +0000 |
| Subject: | fopen 'no error' error? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111592@lists.php.net to get a copy of this message | ||
i get the strangest intermittent error when fetching urls with fopen.
Warning: fopen("http://weather.yahoo.com/forecast/USCA1225_f.html", "r") - No error in c:\program files\apache group\apache\htdocs\weather_funcs.php on line 3
here's the code
function fetchweather($where) {
$fp = fopen("http://weather.yahoo.com/forecast/USCA1225_f.html","r");
if($fp){
$using=0;
while($d=fgets($fp,1024)) {
if ($d == "<!-- --------------------- FORECAST ------------------------->\n") {
$using=1;
}
if ($using == 1) {
$lines=$lines.$d;
}
if ($d == "<!-- ENDFC-->\n") {
$using=0;
}
}
fclose($fp);} else { return "Error!!"; } return ($lines); } What is 'NO ERROR' supposed to mean? It does not fetch anything when I get that error. But how can i solve this problem? this code is included on all pages, but it fails only on some, but i can't tell why. _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx