List MP4 files in a directory


#1

Hi Guys,

I have a folder www.toolfolks.com/videos that has various videos in there.

I need to read the directory and the populate a form with some clickable thumbnails of the videos.

ie replicate how youtube works.

I have this php working but not sure whats next.

<?php
echo "Here are our files";
$path = ".";
$dh = opendir($path);
$i=1;
while (($file = readdir($dh)) !== false) {
    if($file != "." && $file != ".." && $file != "index.php" && $file != ".htaccess" && $file != "error_log" && $file != "cgi-bin") {
        echo "<a href='$path/$file'>$file</a><br /><br />";
        $i++;
    }
}
closedir($dh);
?> 

Cheers

Steve Warby.