"Dustin Krysak" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there....
>
> What I am hoping to do is have a drop down menu that would be populated
> from the contents of a directory via php. Now The link names would be
> generated by the file name minus the file extension. Has anyone seen a
> tutorial on accomplishing something like this? All of the links would
> be to quicktime movies, but I am hoping to have them embedded in HTML
> (or PHP)..... So the movie is displayed in a browser....
>
> thanks in advance!

This should do the trick:

// opening select tag goes here...

if ($handle = opendir('/path/to/files')) {
   while (false !== ($file = readdir($handle)))

       if ($file != '.' && $file != '..')

           $fileName = str_replace('.mov', '', $file);
           echo '<option value="' . $file . '">' . $fileName . '</option>';
       }
   }
   closedir($handle);
}

// closing select tag goes here

Haven't tested it. Hope it works and helps ;)

Regards,

Torsten Roehr

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to