<?
$count = 0;$count3 = 0;$count4 = 0;$count5 = 0;$count6 = 0;$count7 = 0;
if ($dir = opendir("images"

) {
while (($file = readdir($dir)) !== false) {
$filename[$count] = $file;
$count++;
}
closedir($dir);
}
$count1 = count ($filename);
$count7 = 0;
for($z = 0; $z < $count1; $z++){
if(strstr($filename[$z],$Month2)){
$filenamemonth2[$count7] = $filename[$z];
$count7++;
}
}
$count20 = count ($filenamemonth2);
// ******************************************
// ** **
// ** Beginning of HTML Code !!!!! **
// ** **
// ******************************************
echo "<html>
<head>
<meta http-equiv=Content-Language content=en-us>
<meta name=GENERATOR content=Microsoft FrontPage 5.0>
<meta name=ProgId content=FrontPage.Editor.Document>
<meta http-equiv=Content-Type content=text/html; charset=windows-1252>
<title>New Page 1</title>
</head>
<body topmargin=0 leftmargin=0><table width=%100 border=0 align=center>";
if(!$submit){
echo"<tr>
<td width=%100 align=center valign=top>
<br>
<form method=POST action=userstats.php>
<p>
Choose a Server<br>
<select size=1 name=Server>
<option value=jpg>jpg</option>
<option value=gif>gif</option>
</select></p>
<p><input type=submit value=submit name=submit><input type=reset value=Reset name=B2></p>
</form>
<p> </td>";
}else{
if($Server){
for($z = 0; $z < $count20; $z++){
if(strstr($filenamemonth2[$z],$Server)) {
$filenameans = $filenamemonth2[$z];
echo"<tr>
<td align=center>
<a href=xls/$filenameans>$filenameans</a></td>
</tr>";
}
}
}
}
echo "</table>";
?>
I had to remove some code but just as an example grab everything into array then search array for the file extensions gif jpg your choice and display them.
You can modify to count array object minus certain files etc..