質問編集履歴
2
文章を修正提示コードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -19,6 +19,110 @@
|
|
19
19
|
OS: さくらvps CentOS stream8
|
20
20
|
|
21
21
|
|
22
|
+
|
23
|
+
##### index.php
|
24
|
+
|
25
|
+
```
|
26
|
+
|
27
|
+
<!DOCTYPE html>
|
28
|
+
|
29
|
+
<html>
|
30
|
+
|
31
|
+
<head>
|
32
|
+
|
33
|
+
<title>test</title>
|
34
|
+
|
35
|
+
<meta charset="UTF-8">
|
36
|
+
|
37
|
+
</head>
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
<body>
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
<center>
|
46
|
+
|
47
|
+
<h1> 掲示板 </h1>
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
<?php
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
$file = "board.txt";
|
56
|
+
|
57
|
+
if(file_exists() == true)
|
58
|
+
|
59
|
+
{
|
60
|
+
|
61
|
+
$board = json_decode(file_get_contents($file));
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
foreach($board as $message)
|
66
|
+
|
67
|
+
{
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
echo '<p>' ,$message[0], '</p>';
|
72
|
+
|
73
|
+
echo '<p>' ,$message[1], '</p><hr>';
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
?>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
<form action="input-text.php" method="post">
|
88
|
+
|
89
|
+
<p> 名前 </p>
|
90
|
+
|
91
|
+
<input type="text" name="name">
|
92
|
+
|
93
|
+
<p> 文章 </p>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<textarea name="comment" cols="30" row="5"></textarea></br>
|
98
|
+
|
99
|
+
<input type="submit" value="投稿">
|
100
|
+
|
101
|
+
</form>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
</center>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
</body>
|
116
|
+
|
117
|
+
</html>
|
118
|
+
|
119
|
+
```
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
##### text-input.php
|
22
126
|
|
23
127
|
```
|
24
128
|
|
1
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
|
6
|
+
|
7
|
+
※下記画像は上のboard.txtファイル問題のファイルです。またhtmlディレクトリに格納しています。同じディレクトリの中です。
|
8
|
+
|
9
|
+
![イメージ説明](823b1228b7837f9a379b2a37e1bb8533.png)
|
10
|
+
|
11
|
+
![イメージ説明](0cbf4d3d67262e782d7c84e2575ac428.png)
|
6
12
|
|
7
13
|
|
8
14
|
|