Does anybody know how I can read a directory and put all of the names of the files into a form. After I do that I will also need to sort the contents of the form alphabeticaly. But any help would be very appreciated.

Now I am trying to make it so that it only will print the names of the files and not the whole path to the file and file name. Because in the drop down form it looks like this;

/path/to/image/dir/picture.gif

all the way down. But they are in alphabetical order, and that's good. just two more steps and it will be complete. The next is to get it so that there are file names only, and the to only print files with certain extention.

I tried using the s//g thing to get rid of the path before the picture but I never have used it before.