TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 11-17-2010, 08:24 PM   #1 (permalink)
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
Click image for larger version

Name:	dropdown.png
Views:	9
Size:	2.5 KB
ID:	289  Click image for larger version

Name:	folder.png
Views:	25
Size:	10.8 KB
ID:	290  
gillweb is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a gallery class Tanax Advanced PHP Programming 25 02-19-2013 04:25 AM
Determine if this folder is the last level within that folder? Peuplarchie General 1 03-01-2010 04:27 AM
Check if specific folder contains files, folders, both or none ? Peuplarchie General 1 02-27-2010 04:36 AM
How use PHP to read image files from a folder and display them in Flex 3 tilelist. chunL Absolute Beginners 12 07-13-2009 01:49 AM
Adding Images to a database from a folder Rendair Advanced PHP Programming 3 01-13-2008 07:40 PM


All times are GMT. The time now is 05:12 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design