Soo ich hab das ganze nun endlich geschafft hier der Quelltext nochmal:
Code:
<?php
$path = 'images/';
$
handle=opendir($path);
while ($file = readdir ($
handle)) {
if ($file != "." && $file != "..") {
$array[] = $file;
}
}
$i = 1;
closedir($
handle);
sort($array);
echo "<select name=\"testdrop\">";
foreach($array as $file) {
$replace = "";
$file = str_replace(".JPG", $replace, $file);
echo "<option value=\"Datei ".$i."\">".$file."</option>";
$i++;
}
echo "</select>";
?>