Here's my problem. All that I want to do is print the tile and contents of each file, in this case log files, found in a directory to a browser.
At the moent, however, my script will only print the title and contents of the first file it finds.
Can anybody help????
<?
$logs_dir = "/LOGS/";
$dp=opendir($logs_dir);
while($file = readdir($dp))
{
$filenames[] = $file;
}
for($i=0;$i<count($filenames);$i++)
{
if($filenames[$i] != '.'&& $filenames[$i] != '..')
{
$filenames[$i] = $logs_dir.$filenames[$i];
print"<b>$filenames[$i]</b><br>";
}
##########################################
if($filenames[$i] != '.'&& $filenames[$i] != '..')
{
$readlines = file($filenames[$i]);
for($i=0;$i<count($readlines);$i++)
{
print"$readlines[$i]<br><br>";
}
}
##########################################
//}
}
?>