$photo_location = "img/";
$photo_category = $_POST['gallery'];
$target_path = "img/";
$thumbTarget = "img/thumb_";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$thumbTarget = $thumbTarget . basename( $_FILES['uploadedfile']['name']);
$unsorted = scandir($photo_location);
foreach ($unsorted as $filename) {
if(ereg("thumb",$filename) && ereg($photo_category,$filename)) {
$images_list[] .= "$filename .
";
}
}
$numImgs = count($images_list);
print_r($images_list);
echo $target_path;
echo "
";
echo $thumbTarget;
echo "
";
echo $numImgs;
echo "
";
echo $photo_category;