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

質問編集履歴

1

具体化

2016/07/04 16:37

投稿

earnest_gay
earnest_gay

スコア615

title CHANGED
File without changes
body CHANGED
@@ -15,13 +15,13 @@
15
15
  <td colspan="2">
16
16
  <input type="tel" class="tel1" name="tel1" value="<?php echo h($_POST['tel1']); ?>" maxlength="4" pattern="^[0-9]+$" title="半角数字以外入力できません。" required>
17
17
  -
18
- <input type="tel" class="tel2" name="tel2" value="<?php echo h(filter_input_array(INPUT_POST, 'tel2')); ?>" maxlength="5" pattern="^[0-9]+$" title="半角数字以外入力できません。" required>
18
+ <input type="tel" class="tel2" name="tel2" value="<?php echo h(filter_input(INPUT_POST, 'tel2')); ?>" maxlength="5" pattern="^[0-9]+$" title="半角数字以外入力できません。" required>
19
19
  -
20
20
  <input type="tel" class="tel3" name="tel3" value="<?php echo h(filter_input(INPUT_POST, 'tel3')); ?>" maxlength="5" pattern="^[0-9]+$" title="半角数字以外入力できません。" required>
21
21
  </td>
22
22
  ```
23
23
  $_POST['tel1']では表示されていますが
24
- filter_input_array(INPUT_POST, 'tel2')では表示されません。
24
+ filter_input(INPUT_POST, 'tel2')では表示されません。
25
25
 
26
26
  また冒頭のURLパラメータで判定している中で
27
27
  エラーがでる)filter_input_array(INPUT_POST) = $_SESSION;
@@ -29,4 +29,7 @@
29
29
 
30
30
  になるんですがこれはなぜでしょうか?
31
31
  $_POSTとfilter_input_array(INPUT_POST)は
32
- 記述が違うだけで動作としては同じだと思っていたのですが、、、
32
+ 記述が違うだけで動作としては同じだと思っていたのですが、、、
33
+
34
+
35
+ 色んなvalueにfilter_input()で記述していっているので、できればそのままのfilter_input()で対応させたいのですが何か方法はないでしょうか?