how would I go about getting directory list to appear in a drop down menu

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • behindspace

    how would I go about getting directory list to appear in a drop down menu

    I'm working on a website for a friend, and I want to let him select an
    image from a dropdown menu for his posts. how would I go about getting
    that to work? I know you can echo the directory contents by using `ls -al`
    could this be done the same way?

  • Kim Madsen - ComX

    #2
    Re: how would I go about getting directory list to appear in a dropdown menu

    behindspace wrote:[color=blue]
    > I'm working on a website for a friend, and I want to let him select an
    > image from a dropdown menu for his posts. how would I go about getting
    > that to work? I know you can echo the directory contents by using `ls -al`
    > could this be done the same way?[/color]

    $handle = opendir($dir);
    while($file = readdir($handle )) {
    if(ereg("\.(jpg |jpeg|gif)^, $file))
    print "$file<br>" ; // work with the data like You want to
    }

    --
    Sincerly
    Kim Madsen
    Systemdeveloper / ComX - http://www.comx.dk

    Comment

    Working...