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

質問編集履歴

1

一部ミスが有ったので訂正しました

2017/08/21 11:44

投稿

penginer
penginer

スコア32

title CHANGED
File without changes
body CHANGED
@@ -10,12 +10,40 @@
10
10
  選択していない部分の値が全て
11
11
  Undefined offset: x(xは選択していない部分の値)と
12
12
  なって出てきてしまいます。
13
- また、複数を選択しても、最終的に出力される答えは常に、値が1の物のみになってしまいます。
13
+ また、複数を選択しても、最終的に出力される答えは常に、値が大きい物のみになってしまいます。
14
14
 
15
15
 
16
16
 
17
17
  ###該当のソースコード
18
18
  ```ここに言語を入力
19
+ <?php
20
+ if (empty($_POST['attribute'])) {
21
+ $errors['attribute'] = "属性が入力されていません。";
22
+
23
+ }/* elseif (htmlspecialchars(ctype_digit(strval($_POST['attribute'])), ENT_QUOTES) == false) {
24
+ $errors['attribute'] = "不正なPOSTです。(属性1)";
25
+
26
+ } */elseif (intval($_POST['attribute']) > 22) {
27
+ $errors['attribute'] = "不正なPOSTです。(属性)";
28
+
29
+ } else {
30
+ $attribute = $_POST['attribute'];
31
+ }
32
+ if (intval($_POST['attribute']) == 22) {
33
+ $x = $_POST['attribute_custom'];
34
+ if (($x == null) && (intval($_POST['attribute']) == 23)) {
35
+ $errors['attribute_custom'] = "属性が入力されていません。(カスタム1)";
36
+
37
+ }
38
+ else if ((str_replace(' ' ,'', $_POST['attribute_custom']) == "") && (intval($_POST['attribute']) == 23)) {
39
+ $errors['attribute_custom'] = "属性が入力されていません。(カスタム2)";
40
+
41
+ } else {
42
+ $attribute_custom = $_POST['attribute_custom'];
43
+ }
44
+ }
45
+
46
+ ?>
19
47
  <?php
20
48
  $attribute2 = array(
21
49
  1 => 'a',