if(!isset($_POST['upload'])) {echo '<form name="upload" enctype="multipart/form-data" method="POST" action="'.$_SERVER['REQUEST_URI'].'"><input type="file" name="file" size="13" value=""><br /><input type="submit" name="upload" value="Upload"></form>';} else {if(($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") ||($_FILES["file"]["type"] == "image/png") ||($_FILES["file"]["type"] == "image/jpg")){$uploaddir = 'uploads/';$filename = $_FILES['file']['name'];$filesize = $_FILES['file']['size'];$tmpname_file = $_FILES['file']['tmp_name']; $date_file = date(imdy);move_uploaded_file($tmpname_file, "$uploaddir$date_file$filename");//Connection MySQL//Select DB//update MySQL}else{echo"Invalid file type.";} }