View Single Post
Old 11-17-2010, 08:24 PM   #1 (permalink)
gillweb
The Wanderer
 
Join Date: Feb 2008
Posts: 13
Thanks: 3
gillweb is on a distinguished road
Default Getting Extra Files Shown In Folder???

I am using this code in a PHP script to list all the files in a folder.
PHP Code:
                <select name="menu1">
                    <?php 
                $dir 
"/img/logos"

                
// Open a known directory, and proceed to read its contents 
                
if (is_dir($dir)) { 
                   if (
$dh opendir($dir)) { 
                       while ((
$file readdir($dh)) !== false) { 
                           print 
"<option value=\"{$file}\">{$file}</option>\n"
                       } 
                       
closedir($dh); 
                   } 
                } 
                
?>
                  </select>
Works great EXCEPT i'm getting extra files being read in the folder and showing just as dots?
You can see from this screen that i have no other files in the directory but this screen shows the extra in my dropdown menu?

Any help?
Attached Thumbnails
getting-extra-files-shown-folder-dropdown.png  getting-extra-files-shown-folder-folder.png  
gillweb is offline  
Reply With Quote