<?php
if ($h = opendir('.')) {
// Uncomment the commented lines if you
//want to list just mp3 and avi files
// $pat="(\.mp3$)|(\.avi$)";
while (false !== ($file = readdir($h)))
{
if ($file != '.' && $file != '..' && substr($file,1) != '.') {
if(is_dir($file) ) continue;
// if(! eregi($pat, $file)) continue;
$filelist .= '<a href="'.$file.'">'.$file.'</a><br>';
}
}
closedir($h);
}
echo $filelist ;
?>