Hi ,
I am pretty new to php. I would like to create a php website based on folders.
I have a code so far that shows the names of folder in a selection box. What I would like to achieve now is how i get the images inside the folder after I click on submit. I know how to get the images with a glob function. What I don't know is how to get the value of each specific folder name. How would I do that?
I have this code so far to get the names of the folders in the selection box:
<form action="test.php" method="post">
<select name="myDirs">
<option value="" selected="selected">Select a genre</option>
<?php
$dirs = glob("*", GLOB_ONLYDIR);
foreach($dirs as $val){
echo '<option value="'.$val.'">'.$val."</option>\n";
}
?>
</select>
<input type="submit" name="submit2">
<?php
if (isset($_POST['submit2']))
foreach($dirs as $val){
{
echo $val;
}
}
?>
</form>
How could get I'm now images which are in the folder of which folder names appear in the selection box?