php upload file condition not working -
i have page the visitor can upload file, thats not required, in script put condition if file input (i named 'upload') not set or empty don't upload anything, , file name equal 'file' existed in db; else upload it. problem condition not working; when leave input empty upload script executed; know because messages declared in script here coded , thank you //select exercice $ex_query = mysqli_query($link, " select * exercices id = '".$exercice_id."' "); $exercice = mysqli_fetch_assoc($ex_query); // --- update script if post if ($_server['request_method'] == 'post') { if (isset($_files["upload"]) && !empty($_files["upload"])){ $target_dir = "docs/"; $date_f_n = date("y-m-d_h-i-sa"); $file_n = basename( $_files["upload"]["name"]); $file_n = $date_f_n.$file_n; $target_file = $target_dir . $file_n; $up...