Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member Tonic's Avatar
    Join Date
    Jan 2004
    Posts
    25
    Member #
    4684
    Hey, I was wondering how to display a list of files of a certain folder (for example, image files for admin area) in a drop down menu? If there is more than one way, what would be the most 'stable' way... I believe that I've tried doing that using pagefile methods, but it's been so long. Anyway, thanks

  2.  

  3. #2
    Senior Member Stylise's Avatar
    Join Date
    Jul 2005
    Location
    Mount Martha, Australia
    Posts
    229
    Member #
    10679
    This is taken from a site i'm currently working on, it works fine for me

    PHP Code:
    function getIconList()
    {
        
    $dir "../uploads/icons/";

        if (
    is_dir($dir))
        {
           if (
    $dh opendir($dir)) {
               while ((
    $file readdir($dh)) !== false)
               {
                    
    $title str_replace("_"" "$file);

                    if (
    filetype($dir $file) != "dir" && strstr($title".jpg"))
                    {
                          
    $iconOptions $iconOptions .
                            
    "<option value=$file>$title</option>";
                    }
               }
               
    closedir($dh);
           }

            return 
    $iconOptions;
        }



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:46 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com