Basically, once I have a list of all filenames in /LOGS/, I want to output the title and contents of each file to the browser.
I.E; TITLE -> CONTENTS -> TITLE -> CONTENTS
At the moment, however, all that is being displayed ss the title and contents of the first file in the /LOGS/ dir.
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>";
}
}
##########################################
//}
}
?>