This is probably a dumb question from a php newbie
I am using this code to generate a list of files in a folder, with a checkbox next to each name.
Code: Select all
//path to directory to scan
$directory = "../";
//get all image files with a .jpg extension.
$images = glob($directory . "*.jpg");
//print each file name
foreach($images as $image)
$image = substr($image, 3);
echo "<input name='Select' type='checkbox' value='' />" . $image . "<br />";
I want the users to be able to select the checkbox next to the name
Then my php will get the selected images into an array or a string separated by commas, so I can zip up the selected files for them to download.
Is there a better way of creating the list?