質問編集履歴

4

タグ戻し

2016/08/18 15:03

投稿

toutou
toutou

スコア2050

test CHANGED
File without changes
test CHANGED
File without changes

3

タグ増やし

2016/08/18 15:03

投稿

toutou
toutou

スコア2050

test CHANGED
File without changes
test CHANGED
File without changes

2

postをfilesに変更

2016/08/18 15:02

投稿

toutou
toutou

スコア2050

test CHANGED
File without changes
test CHANGED
@@ -54,7 +54,7 @@
54
54
 
55
55
  if($_POST['ap']){
56
56
 
57
- $fa= ($_POST['fa']);
57
+ $fa= ($_FILES['fa']);
58
58
 
59
59
  $fa2= $fa.".txt";
60
60
 
@@ -70,7 +70,7 @@
70
70
 
71
71
  if($_POST['ap']){
72
72
 
73
- $fa= ($_POST['fa']);
73
+ $fa= ($_FILES['fa']);
74
74
 
75
75
  $fa2= str_replace(dic,txt,$fa);
76
76
 

1

html部分を追加

2016/08/18 13:41

投稿

toutou
toutou

スコア2050

test CHANGED
File without changes
test CHANGED
@@ -29,6 +29,22 @@
29
29
  POSTから取り出し変数にいれ文字列として ..txtでファイル名の最後に足してみた。
30
30
 
31
31
  str_replaceで拡張子の文字を変更してみた。
32
+
33
+
34
+
35
+ ```
36
+
37
+ <form method="post" enctype="multipart/form-data">
38
+
39
+ ファイル<br>
40
+
41
+ <input type= "file" name= "fa" ><br>
42
+
43
+ <input type="submit" name="ap" value="アップロード">
44
+
45
+ </form>
46
+
47
+ ```
32
48
 
33
49
 
34
50