Hi Guys
I am currently using the opendir to display all files and folders in a specific directory code below. It displays great however it display each file twice. If it is a folder then it will just display once. I have check the folder on the server and there is only the one version within the folder. I have used the same code on another part of the site and it works perfectly.
<select name="deleteFile">
<option value="">select file</option>
<? $folder = "../course/".$dir."";
$handle = opendir($folder);
# Making an array containing the files in the current directory:
while ($file = readdir($handle)) {
$files[] = $file;
}
closedir($handle);
#echo the files
foreach ($files as $file) {
if($file!='.' && $file!='..') {
echo('<option value="'.$file.'">'.$file.'</option>');
}
} ?>
</select>
Any help will be great.
Cheers
Neil