Я пытаюсь добавить загруженные файлы из каталога в элемент формы в HTML.Я получаю абсолютно ничего, когда я запускаю страницу (даже HTML).Вот код:
<html>
<head>
</head>
<body>
<form name="adgen" id="adgen" method="post">
Choose a Banner Image: <select name="banimg">
<?php
//This variable specifies the file path for the banner image
$filepath="imgdir";
//This variable opens the directory for the correct file path for this select option
$openimg=opendir($filepath);
//This loops through the directory of files and if it finds a file it displays it as an option in the select form element
while($imgsel=readdir($openimg)){
if($imgsel !=".." && $imgsel !="."){
echo '<option value="'.$imgsel.'">'.$imgsel.'</option><br />');
}
}
closedir($openimg);
?>
</select>
</form>
</body>
</html>
Дайте мне знать, если вы видите, что вешает трубку.