Is it possible (I am assuming not) to populate a drop down list from files that are on my website, say in the images folder? in a html form?
Try it like this:
<select name="s1">
<option value="" selected="selected">-----</option>
<?php
foreach(glob(dirname(__FILE__) . '/images/*') as $filename){
$filename = basename($filename);
echo "<option value='" . $filename . "'>".$filename."</option>";
}
?>
</select>
You can use scandir
- http://php.net/manual/en/function.scandir.php
Then just run a foreach
on the returned array and echo <option>
for each one.