質問編集履歴

2

elseの階層

2015/11/20 13:34

投稿

DaikiYamada
DaikiYamada

スコア11

test CHANGED
File without changes
test CHANGED
File without changes

1

elseの階層

2015/11/20 13:34

投稿

DaikiYamada
DaikiYamada

スコア11

test CHANGED
File without changes
test CHANGED
@@ -78,29 +78,31 @@
78
78
 
79
79
  $img_data = "images/" . $_FILES["img_data"]["name"];
80
80
 
81
+
82
+
83
+ if (!move_uploaded_file($_FILES["img_data"]["tmp_name"], $img_data)) {
84
+
85
+ $errors['file_upload_failure'] = "ファイルのアップロードに失敗しました。";
86
+
81
- }
87
+ }
82
-
83
-
84
-
88
+
85
- if (!move_uploaded_file($_FILES["img_data"]["tmp_name"], $img_data)) {
89
+ } else (file_exists($img_data)) {
86
-
90
+
87
- $errors['file_upload_failure'] = "ファイルのアップロードに失敗しした。";
91
+ $errors['file_upload_none'] = "画像が選択されておりせん";
88
-
92
+
89
- }
93
+ }
90
-
94
+
91
- }
95
+ }
92
-
96
+
97
+
98
+
93
- if (file_exists($img_data)) {
99
+ if (empty($errors)) {
94
-
100
+
95
- $errors['file_upload_none'] = "画像が選択されておりません";
101
+ header('location: postdone.php');
102
+
96
-
103
+ exit;
104
+
97
- }
105
+ }
98
-
99
-
100
-
101
- //var_dump($errors['file_extension']);
102
-
103
- //echo h($errors['file_upload_none']);
104
106
 
105
107
  }
106
108