isset and !empty not passing through a check for uploaded files
问题 I have an upload form with a file to be uploaded. The issue I have is that even when no file is uploaded the if(isset($_FILES)) OR if(!empty($_FILES)) still passes as successful: $_FILES = $HTTP_POST_FILES; if($_POST['type'] == 'photo' && isset($_FILES)){ // returns true even if no file is uploaded. What am I missing! } 回答1: Being a superglobal, $_FILES is presumably always set, regardless whether an uploaded file exists or not. Check for the file upload(s) you would expect and look at the