finding folders.
Posted: Mon Dec 01, 2003 10:32 am
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?
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?