if(file_exists("user/".$userid."/".$images[$i])) { move_uploaded_file($file_tmp=$_FILES["images"]["tmp_name"][$i],"user/".$userid."/".$images[$i]); } else { mkdir($baseUrl.$userid); move_uploaded_file($file_tmp=$_FILES["images"]["tmp_name"][$i],$baseUrl.$userid."/".$images[$i]); // move_uploaded_file($_FILES['profile_pic']['tmp_name'], "user/".$userid."/".$file_name); } //19-02-2019 for ($i = 0; $i < count($_FILES['images']['tmp_name']); $i++) { // echo count($_FILES['images']['tmp_name']); $file_name = $_FILES['images']['name'][$i]; $file_size = $_FILES['images']['size'][$i]; $file_tmp = $_FILES['images']['tmp_name'][$i]; $t = explode(".", $file_name); $t1 = end($t); $file_ext = strtolower(end($t)); $ext_boleh = array("jpg", "jpeg", "png", "gif", "bmp"); /*if(in_array($file_ext, $ext_boleh)) {*/ $imagefile = $file_name.".jpg"; $imagepath = "user/" . $imagefile; move_uploaded_file($imagefile, $imagepath); /*$sql = "insert into database_latihan values ('$Kode' , '$Tipe' , '$tujuan')"; mysqli_query($koneksi, $sql);*/ // $finalpath = $baseUrl.$userid."/".$all_images; $finalpath = $baseUrl."/".$all_images; $user_gallery = mysqli_query($con,"insert into user_status_gallery(user_id,image,create_at,update_at) values('$userid','".$imagepath."',NOW(),NOW())"); /* }else { echo "Only Images can be store!"; }*/ /*move_uploaded_file($_FILES['profile_image']['tmp_name'],"user/".$profile_image); mysqli_query($con,"INSERT INTO tbl_comments (usr_id,cmt_comment,cmt_image,pst_id,cmt_date) VALUES ('$userid','$comment','$image','$postid',NOW())");*/ }