Page 1 of 1

finding folders.

Posted: Mon Dec 01, 2003 10:32 am
by nemode
is there a way to find all the folders in a directory and then have them placed into a dropdown box????

although ok at php. this is what i thought of. doesn work though. :S

<select name='folder' class='dropdown'>
<?php
$handle = @opendir( '../folders/' );
$matches = array();
if ( $handle != '' ) {
while ( $file = readdir($handle)) {
$matches[] = $file;
}
}
for($i = 0, $j = count($matches); $i < $j; $i++) {
echo "<option value='", $matches[$i] ;
echo "'></option>";
}

?>
</select>
anyone have any ideas?

Posted: Mon Dec 01, 2003 10:43 am
by infolock
i have been looking for the same thing, and found this just then :

http://www.g2k.dk/stuff/txt/directory/

http://www.computing.net/programming/ww ... /8345.html

you may be able to use this function to do just what you need. I know it's gonna work for me (having to wait at school for my class to begin/end before i can get home and try it out to be sure though..).