Hi guys,
I have a form that allows five photo uploads at once. The thing is when the user uploads only one photo that should be it... but it still tries to upload and move the other, non existent photos. I have an if statement that does not seem to be working.... here it is:
<?php
//IF THERE IS A FIFTH PICTURE
if (isset($_FILES['articlePicFive']) || $_FILES['articlePicFive'] != NULL || $_FILES['articlePicFive'] != '') {
$imageName = $gathered['articleId'];
// PROCESS IMAGE
$target_path = "../images/articles/";
$target_path = $target_path . basename( $_FILES['articlePicFive']['tmp_name']);
$_FILES['articlePicFive']['tmp_name'];
//MOVE THE IMAGE TO THUMBNAILS
move_uploaded_file($_FILES['articlePicFive']['tmp_name'], $target_path);
//EXPLODE TO RENAME IMAGE
$fileName = $_FILES['articlePicFive']['name'];
$broken = explode(".", $fileName);
rename("../images/articles/".basename($_FILES['articlePicFive']['tmp_name'])."", "../images/articles/".$imageName."_05." .$broken[1]."");
$update = mysql_query("UPDATE articles SET articlePicFive='" .$imageName."_05." .$broken[1]. "' WHERE articleId='".$imageName."'" ) or die(mysql_error());
}
?>
What am I doing wrong? See if statement at the start... even though the form fiels is empty it is treating it as there is a file...
Thanks