i’m having the user select a specific file from a directory using a drop down menu that opens and reads a directory.
there are some items in the directory listing that shouldn’t be there. items like
.
..
.com.apple.timemachine.supported
.DS_Store
how would i go about at removing these? they look like directory commands or information or something. the user shouldn’t be able to select these, even though i don’t think they ever would.
here is the code i’m using to read the directory and print the items into a drop down.
<div id='fileOpen'>
<?
$pathToImages = 'images/';
$pathToVolume = '/Volumes/storage/spots_in/';
if ($handle = opendir($pathToVolume)) {
?>
<span class='locate'>Locate master file:</span>
<select id='file' name='file'>
<?
while (false !== ($entry = readdir($handle))) {
echo "<option>";
echo "$entry\n";
echo "</option>";
}
closedir($handle);
}
</div>
I use this