回答編集履歴
1
追加
answer
CHANGED
@@ -14,10 +14,12 @@
|
|
14
14
|
foreach($vege as $val){
|
15
15
|
$checked["vege"][$val]=" checked=\"checked\"";
|
16
16
|
}
|
17
|
+
$veges=htmlspecialchars(implode("、",$vege));
|
17
18
|
$fruit=filter_input(INPUT_POST,"fruit",FILTER_DEFAULT,$option);
|
18
19
|
foreach($fruit as $val){
|
19
20
|
$checked["fruit"][$val]=" checked=\"checked\"";
|
20
21
|
}
|
22
|
+
$fruits=htmlspecialchars(implode("、",$fruit));
|
21
23
|
print_r($checked);
|
22
24
|
print <<<eof
|
23
25
|
<form method="post">
|
@@ -36,7 +38,17 @@
|
|
36
38
|
</div>
|
37
39
|
<button class="submit-btn">送信</button>
|
38
40
|
</form>
|
41
|
+
<hr>
|
42
|
+
<div class="search-result">
|
43
|
+
<h1>検索結果</h1>
|
44
|
+
<h2>野菜</h2>
|
45
|
+
<p>{$veges}</p>
|
46
|
+
<h2>フルーツ</h2>
|
47
|
+
<p>{$fruits}</p>
|
48
|
+
</div>
|
49
|
+
|
39
50
|
eof;
|
40
51
|
?>
|
41
52
|
|
42
|
-
```
|
53
|
+
```
|
54
|
+
※結果欄を追記しておきました
|