Re: fopen with URL gives me a problem

From: Date: Mon, 02 Apr 2001 23:26:06 +0000
Subject: Re: fopen with URL gives me a problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-46719@lists.php.net to get a copy of this message
> Now i get a error window saying: "Document contained no data" That usually means PHP crashed. Check your web-server error logs. Also, try adding some debug output before each statement to pinpoint the crash line. > ----------code----------------- > > $noaa = > "http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=MUHA" ; > $wfile = fopen ($noaa, "r"); > > > $weathcont = fread ($wfile , 1024); > > ereg (" ([0-9][0-9])/([0-9][0-9]) " , $weathcont, $reg); > > $far = 32 + ( $reg[1] / (5.0 / 9.0)); > $data = date("d F"); > $ora = (date("H")-6); > > echo "<font size=\"-1\" color=\"SteelBlue\"><b> > Temperature in Habana, on $data, at "; > if ($ora < 0){ > $timezone = ($ora + 24); > echo $timezone; > }else{ > echo $ora ; > } > echo " is:</b></font><br> > <font color=\"SteelBlue\"><b>$reg[1] C ($far > F)</b></font>"; > fclose($wfile); > > --------end of code -------------------------- -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#46719) next »