i have a script to select file from a folder. they are all images(.jpg) right now, but i would like to be able to put video files(.mov,.wmv,.mpeg) in the same folder, but the catch is, i want the images in one spot on the page and the videos on another spot.
heres the script im current ly using which work fine, i just want to know how to adapt it to do the above.(the popup fuction just adds javascript to the <a href> it doesnt do anything else)
<?php
if (false !== ($dhandle = opendir($dirPath)))
{
$num = 0;
while (false !== ($filename = readdir($dhandle)))
{
if ($filename != "." && $filename != "..")
{
popup("", "$filename", "$dirPath/$filename", "check.php?picture_location=./$dirPath/$filename&picture_save=./riderpics/nothing.jpg&size=50", "Description");
?>
<br>
<?php
$num++;
}
}
}
?>