Hey everyone,
Been working on a php snippet which finds the names of all the files in a Directory and populates them into a drop down box. Which would then allow me to select that file, click a submit button and delete them.
Here is what I have SO
<?php
$path = "uploads/";
$handle = opendir($path);
while ($file = readdir($handle)) {
if (substr($file,0,1) != ".") {
echo "<option value ='$file'></option>";
}
}
closedir($handle);
?>
This does not work, however, Replace the echo with:
echo $file . "<br>";
And it does work, Any help? Thanks guys