Código PHP:
<?
function listar()
{
echo '<select name="lista">';
$dir = opendir("./imagenes/");
while($listar_d = readdir($dir))
{
if ($listar_d[0] != "." && $listar_d[0] != ".." )
{
echo "<option value=\"$listar_d\">$listar_d</option>";
}
}
echo '</select>';
closedir($dir);
}
echo '<form method="post" action="">';
listar();
echo '</form>';
?>