Re: [PHP] fread over ftp

2001-02-23 Thread Richard Lynch
> if( !($fd = @fopen($ftp_url, "r")) ){ > $error = true; > $error_msg = "Unable to connect to server."; > } > else { > $file_contents = fread($fd, 10); > fclose($fd); > } > > if( empty($file_contents) ){ > $error = true; > $error_msg = "Did not read file."; > } > > > The problem is

[PHP] fread over ftp

2001-02-21 Thread Mark Heintz PHP Mailing Lists
I'm having some trouble reading a text file from a remote server into a string. The code is as follows: if( !($fd = @fopen($ftp_url, "r")) ){ $error = true; $error_msg = "Unable to connect to server."; } else { $file_contents = fread($fd, 10); fclose($fd); } if( empty($file_content