Hi,

I have just begun playing with php. I need to read and output data from hundreds of tiny text files to one flat text file (comma delimited or whatever) for later database import. I am having trouble with the following script:

<?php
$filename = "http://congress.nw.dc.us/cgi-bin/usagelogs.pl?download=1&dir=lchr&logfile=senders030100.txt&textfile=%20Text%20File%28s%29%20";
$file = fopen($filename, "r");
if (!$file) {
echo "<p>Unable to open remote file.n";
exit;
}
$file_content = fread ($file, filesize ($filename));
while (!feof($file)) {
$line = fgets($file, 1024);
echo $line;
}
fclose($file);

echo "<BR><BR>";
echo $file_content;

?>
I can echo the data fine line by line to the browser with the code above, but $file_content appears to be zero length, so echo $file_content doesn't work. Why?? I am having trouble finding the answer in the manual...

Thanks for your help