質問するログイン新規登録

質問編集履歴

4

タグ戻し

2016/08/18 15:03

投稿

toutou
toutou

スコア2052

title CHANGED
File without changes
body CHANGED
File without changes

3

タグ増やし

2016/08/18 15:03

投稿

toutou
toutou

スコア2052

title CHANGED
File without changes
body CHANGED
File without changes

2

postをfilesに変更

2016/08/18 15:02

投稿

toutou
toutou

スコア2052

title CHANGED
File without changes
body CHANGED
@@ -26,7 +26,7 @@
26
26
  ```
27
27
  <?php
28
28
  if($_POST['ap']){
29
- $fa= ($_POST['fa']);
29
+ $fa= ($_FILES['fa']);
30
30
  $fa2= $fa.".txt";
31
31
  var_dump($fa2);
32
32
  ?>
@@ -34,7 +34,7 @@
34
34
  ```
35
35
  <?php
36
36
  if($_POST['ap']){
37
- $fa= ($_POST['fa']);
37
+ $fa= ($_FILES['fa']);
38
38
  $fa2= str_replace(dic,txt,$fa);
39
39
  var_dump($fa2);
40
40
  ?>

1

html部分を追加

2016/08/18 13:41

投稿

toutou
toutou

スコア2052

title CHANGED
File without changes
body CHANGED
@@ -16,6 +16,14 @@
16
16
  str_replaceで拡張子の文字を変更してみた。
17
17
 
18
18
  ```
19
+ <form method="post" enctype="multipart/form-data">
20
+ ファイル<br>
21
+ <input type= "file" name= "fa" ><br>
22
+ <input type="submit" name="ap" value="アップロード">
23
+ </form>
24
+ ```
25
+
26
+ ```
19
27
  <?php
20
28
  if($_POST['ap']){
21
29
  $fa= ($_POST['fa']);