i managed to fix my page...
<?php
//set $filedir to the directory
$directory = ".";
$filedir = dir($directory);
//this loops through the files in the directory, and adds
//them to a list if they have the correct extension
//either jpg, txt or htm at present. change below
$loop = 0;
while ($file = $filedir->read()) {
if (eregi("jpg", $file) || eregi("txt", $file) || eregi("htm", $file)) {
$filestring .= "$file;";
$fullfilename = $directory . "/" . $file;
$modtime = date ("D dS F Y G:i T", filemtime($fullfilename));
$modlist[$loop] = "$modtime;";
}
$loop++;
}
//close the directory handle
closedir($filedir->handle);
//splits the list of files and modified times into an array
$filelist = explode(";", $filestring);
//gets the number of files in the list
$numfiles = sizeof($filelist)-2;
$loop = 0;
print "<table width=90% border=1>\n";
//loops through each file, getting the filename and
//then splitting that into name ($fileparts[0]) and
//extension ($fileparts[1]). Then prints this info out
//into a table
while ($loop <= $numfiles):
$file = $filelist[$loop];
$time = $modlist[$loop];
$fileparts = explode(".", $file);
print "\t<tr>\n";
$fullfilename = $directory . "/" . $file;
$modtime = date ("D dS F Y G:i T", filemtime($fullfilename));
printf("<td>%d</td><td>%s</td><td>%s</td>", $loop, $fileparts[0], $fileparts[1]);
print "<td>$modtime</td>";
print "\t</tr>\n";
$loop++;
endwhile;
?>
it works fully now, and i have attached it below...