質問編集履歴
1
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,6 +46,8 @@
|
|
46
46
|
|
47
47
|
ソースコード
|
48
48
|
|
49
|
+
```PHP
|
50
|
+
|
49
51
|
<!DOCTYPE html>
|
50
52
|
|
51
53
|
<html lang="ja">
|
@@ -64,15 +66,13 @@
|
|
64
66
|
|
65
67
|
<form action="" method="post">
|
66
68
|
|
67
|
-
<input type="text" name="namae" value="名前">
|
69
|
+
<input type="text" name="namae" value="名前">
|
68
70
|
|
69
|
-
<input type="text" name="comment" value="コメント">
|
71
|
+
<input type="text" name="comment" value="コメント">
|
70
72
|
|
71
|
-
<input type="submit" name="sousin">
|
73
|
+
<input type="submit" name="sousin">
|
72
74
|
|
73
|
-
|
74
|
-
|
75
|
-
</form>
|
75
|
+
</form>
|
76
76
|
|
77
77
|
|
78
78
|
|
@@ -96,21 +96,21 @@
|
|
96
96
|
|
97
97
|
if (file_exists($filename)) {
|
98
98
|
|
99
|
-
$n = explode("<>",$filename);
|
99
|
+
$n = explode("<>",$filename);
|
100
100
|
|
101
|
-
for($a=0; $a<$filename;$a++){
|
101
|
+
for($a=0; $a<$filename;$a++){
|
102
102
|
|
103
|
-
$nu = $n[$a];
|
103
|
+
$nu = $n[$a];
|
104
104
|
|
105
|
-
$num = $nu[0];
|
105
|
+
$num = $nu[0];
|
106
106
|
|
107
|
-
}
|
107
|
+
}
|
108
108
|
|
109
109
|
} else {
|
110
110
|
|
111
111
|
$num = 1;
|
112
112
|
|
113
|
-
}
|
113
|
+
}
|
114
114
|
|
115
115
|
//書き込む文字列を組み合わせた変数
|
116
116
|
|
@@ -122,19 +122,21 @@
|
|
122
122
|
|
123
123
|
if (!empty($namae)||!empty($comment)){
|
124
124
|
|
125
|
-
$fp = fopen($filename,'a');
|
125
|
+
$fp = fopen($filename,'a');
|
126
126
|
|
127
|
-
fwrite($fp, $format."\n");
|
127
|
+
fwrite($fp, $format."\n");
|
128
128
|
|
129
|
-
fclose($fp);
|
129
|
+
fclose($fp);
|
130
130
|
|
131
|
-
}
|
131
|
+
}
|
132
132
|
|
133
133
|
?>
|
134
134
|
|
135
135
|
</body>
|
136
136
|
|
137
137
|
</html>
|
138
|
+
|
139
|
+
```
|
138
140
|
|
139
141
|
|
140
142
|
|