I posted this question before it was resolved here. Or was it? You have the same problem again.
I have a page that loads information for a product, including a bunch of gallery images in a catalog. Another page edits this information, including gallery images. If there are images in the download field that I would like to add to the script gallery (This works), if there are no images, then process other changes on the page, but do not include the script gallery.
This works to upload a single image:
if($_FILES['fileField']['tmp_name']!="") { include_once("image_script.php"); }
I tried a bunch of different combinations to make this work for several fields for uploading files. The following are two examples:
if(isset($_FILES['gallery']['tmp_name'])) { include_once("gallery_script.php"); } else { header("location: inventory_list.php"); }
and
if(!empty($_FILES['gallery']['tmp_name'])) { include_once("gallery_script.php"); } else { header("location: inventory_list.php"); }
Every time I try to do this, it still runs the gallery of the script if there are images or no images.
Will this be the case when I have to use something other than empty() or isset() ?
Thanks for any suggestions anyone can offer.
Bjorn
source share