Oh I forgot to mention that its not writing any content to the cache file...
Gerard Samuel wrote:
> Im trying to modify a script that fetches rss newfeeds.
> I was using fopen, but I decided to use fsockopen() for the timeout
> value.
> ----------------------
> <?php
> $data = '';
> $filehandle = fsockopen ($sourceurl, 80, $errno, $errstr, 5);
> if (!$filehandle)
> {
> $data = $errstr;
> }
> else
> {
> while (!feof($filehandle))
> {
> $data .= fgets($filehandle, 1024);
> }
> }
>
> $cacheFile = fopen( _CACHEDIR. $cacheFile, "w");
> fwrite($cacheFile, $data);
> fclose($cacheFile);
> fclose($filehandle);
> ?>
> ---------------------------------------
>
> Does anyone see anything wrong with this code??
> Thanks
>
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php