12-08-2009, 03:06 AM
|
#1 (permalink)
|
|
The Acquainted
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
|
List soted folder in combo box
Good day to you all,
here i'm working on a snippet that list the folder in a folder and return is content to a combo box.
My problem is it don't sort.
Here is my code:
PHP Code:
<?PHP $console = $_GET['console']; $dir = "Names/"; echo "<select name=\"cars\">"; // Open a known directory, and proceed to read its contents $dir_handle = @opendir($dir) or die("Unable to open $dir"); while($file = readdir($dir_handle)) { sort($file); if(is_dir($file)) { if($file != '.' && $file != '..') {
} } else if($file != '.' && $file != '..') { $filing = sort($file); echo "<option value=\"".$path/$filing."\">".$file."</option>"; } } ?> </select>
Thanks !
__________________
That's why we are not alone on earth... let's build !
|
|
|
|