質問編集履歴
4
適切な回答がないので削除お願いします。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,293 +1,25 @@
|
|
1
|
-
現在簡易掲示板の作成をしているのですが、指定した番号を編集するのに手間取っています。名前とコメントフォーム(新規フォーム)、編集したい内容の番号(編集フォーム)をそれぞれ分けて表示しています。
|
2
|
-
|
3
|
-
編集フォームに番号を入れて、新規フォームには変更したい内容(名前とコメント)を入れて編集フォームの”edit”ボタンを押すと指定した番号が新しい内容(名前とコメント)に置き換わっていると、いう状態にしたいのですが、うまく行きません。
|
4
|
-
|
5
|
-
私がhiddenの使い方を完璧に理解していないのとそれぞれのformのvalueへの定義の仕方が悪いためだと思っています。
|
6
|
-
|
7
|
-
お手数ですが、アドバイスをいただけないでしょうか。
|
8
|
-
|
9
|
-
|
1
|
+
コードはマークダウンのcode機能にてご提示ください
|
10
2
|
|
11
3
|
|
12
4
|
|
13
|
-
|
5
|
+
m3tp 9時間前
|
14
6
|
|
15
|
-
リンク
|
16
|
-
|
17
|
-
https://harigami.net/cd?hsh=3305e95d-0cd9-4021-a098-1a1534fec9ee
|
18
|
-
|
19
|
-
|
7
|
+
マークダウンのcodeの使い方が分かりません。
|
20
8
|
|
21
9
|
|
22
10
|
|
11
|
+
m.ts10806 9時間前
|
12
|
+
|
23
|
-
|
13
|
+
ヘルプページにもありますし、質問でも出てます。 https://teratail.com/questions/238564
|
24
14
|
|
25
15
|
|
26
16
|
|
17
|
+
m3tp 9時間前
|
18
|
+
|
27
|
-
|
19
|
+
ご連絡ありがとうございます。コードがわかるURLを添付致しました。よろしくお願い致します。
|
28
20
|
|
29
21
|
|
30
22
|
|
31
|
-
|
23
|
+
m.ts10806 9時間前
|
32
24
|
|
33
|
-
$name=$_POST['name'];
|
34
|
-
|
35
|
-
$comment=$_POST['comment'];
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
$fp=fopen($file, 'a+');
|
40
|
-
|
41
|
-
$date=date('Y-m-d');
|
42
|
-
|
43
|
-
$context="<>" . $name . "<>" . $comment . "<>" . $date;
|
44
|
-
|
45
|
-
$count =1;
|
46
|
-
|
47
|
-
while(fgets($fp)!=false){
|
48
|
-
|
49
|
-
$count++;
|
50
|
-
|
51
|
-
}
|
52
|
-
|
53
|
-
fwrite($fp, $count. $context.PHP_EOL);
|
54
|
-
|
55
|
-
flock($fp, LOCK_UN);
|
56
|
-
|
57
|
-
fclose($fp);
|
58
|
-
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
//file: return array
|
64
|
-
|
65
|
-
$file_array = file($file);
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
// delete function
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
if(isset($_POST['number'])) {
|
74
|
-
|
75
|
-
$delete=$_POST['number'];
|
76
|
-
|
77
|
-
$delete_num=(int)$delete;
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
$fp= fopen($file, 'w+');
|
82
|
-
|
83
|
-
//count includes "0"
|
84
|
-
|
85
|
-
foreach($file_array as $file_cont) {
|
86
|
-
|
87
|
-
$file_num = explode("<>", $file_cont);
|
88
|
-
|
89
|
-
$num=$file_num[0];
|
90
|
-
|
91
|
-
$name=$file_num[1];
|
92
|
-
|
93
|
-
$comment=$file_num[2];
|
94
|
-
|
95
|
-
$date=$file_num[3];
|
96
|
-
|
97
|
-
if ($num == $delete_num) {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}else if($num < $delete_num) {
|
102
|
-
|
103
|
-
fwrite($fp, $num . "<>" . $name . "<>"
|
104
|
-
|
105
|
-
. $comment . "<>" . $date);
|
106
|
-
|
107
|
-
}else{
|
108
|
-
|
109
|
-
$num=$num-1;
|
110
|
-
|
111
|
-
fwrite($fp, $num . "<>" . $name . "<>"
|
112
|
-
|
113
|
-
. $comment . "<>" . $date);
|
114
|
-
|
115
|
-
}
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
}
|
122
|
-
|
123
|
-
fclose( $fp );
|
124
|
-
|
125
|
-
}
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
// edit form
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
if(isset($_POST['edit_button'])){
|
136
|
-
|
137
|
-
for($i=0; $i< count($file_array); $i++){
|
138
|
-
|
139
|
-
$data=explode("<>", $file_array[$i]);
|
140
|
-
|
141
|
-
if($data[0]==($_POST['edit_num'])){
|
142
|
-
|
143
|
-
$simEdit=$data;
|
144
|
-
|
145
|
-
}
|
146
|
-
|
147
|
-
}
|
148
|
-
|
149
|
-
}
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
if(isset($_POST['hidden'])){
|
154
|
-
|
155
|
-
for($j=0; $j<count($file_array); $j++){
|
156
|
-
|
157
|
-
$data2= explode("<>", $file_array[$j]);
|
158
|
-
|
159
|
-
if($data2[0]==($_POST['hidden'])){
|
160
|
-
|
161
|
-
$num=$_POST['hidden'];
|
162
|
-
|
163
|
-
$data2[1]=$_POST['name'];
|
164
|
-
|
165
|
-
$data2[2]=$_POST['comment'];
|
166
|
-
|
167
|
-
$file_array[$j]=implode("<>", $data2);
|
168
|
-
|
169
|
-
file_put_contents($file, implode("", $file_array));
|
170
|
-
|
171
|
-
}
|
172
|
-
|
173
|
-
}
|
174
|
-
|
175
|
-
}
|
176
|
-
|
177
|
-
?>
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
<html>
|
182
|
-
|
183
|
-
<head>
|
184
|
-
|
185
|
-
<title>Kadai2</title>
|
186
|
-
|
187
|
-
</head>
|
188
|
-
|
189
|
-
<h1>Brief board system</h1><br>
|
190
|
-
|
191
|
-
<h2>Register form</h2>
|
192
|
-
|
193
|
-
<form action="" method="post">
|
194
|
-
|
195
|
-
Name:
|
196
|
-
|
197
|
-
<input type="text" name="name" value="<?php if(!empty($_POST['edit_num'])){
|
198
|
-
|
199
|
-
echo $_POST['name'];}?>"><br>
|
200
|
-
|
201
|
-
Comment:
|
202
|
-
|
203
|
-
<input type="text" name="comment" value="<?php if(!empty($_POST['edit_num'])){
|
204
|
-
|
205
|
-
echo $_POST['comment'];}?>"><br><br>
|
206
|
-
|
207
|
-
<input type="submit" name="submit" value="Submit"><br><br>
|
208
|
-
|
209
|
-
<input type="hidden" name="hidden" value="<?php echo ($_POST['edit_num']);?>">
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
</form>
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
<h2>Delete form</h2>
|
220
|
-
|
221
|
-
<form action="" method="post">
|
222
|
-
|
223
|
-
Delete number:
|
224
|
-
|
225
|
-
<input type="text" name="number"><br><br>
|
226
|
-
|
227
|
-
<input type="submit" value="Delete"><br><br>
|
228
|
-
|
229
|
-
</form>
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
<h2>Edit form</h2>
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
<form action="" method="post">
|
238
|
-
|
239
|
-
Edit number:
|
240
|
-
|
241
|
-
<input type="text" name="edit_num"><br><br>
|
242
|
-
|
243
|
-
<input type="submit" name="edit_button" value="Edit"><br><br>
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
</form>
|
250
|
-
|
251
|
-
<h3>Below the Registered context</h3>
|
252
|
-
|
253
|
-
<body>
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
<?php
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
$file_name="kadai2_2.txt";
|
266
|
-
|
267
|
-
$file = file($file_name);
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
foreach($file as $input){
|
272
|
-
|
273
|
-
|
25
|
+
いや、そんな何万字って大量のコードでもないのに外部リンクはやめましょうよ。余計見られなくなります。
|
274
|
-
|
275
|
-
foreach($division as $display) {
|
276
|
-
|
277
|
-
echo $display . "<br/>";
|
278
|
-
|
279
|
-
}
|
280
|
-
|
281
|
-
}
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
?>
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
</body>
|
290
|
-
|
291
|
-
</html>
|
292
|
-
|
293
|
-
```
|
3
markdown
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,135 +16,265 @@
|
|
16
16
|
|
17
17
|
https://harigami.net/cd?hsh=3305e95d-0cd9-4021-a098-1a1534fec9ee
|
18
18
|
|
19
|
+
```<?php
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
$file = "kadai2_2.txt";
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
// register function
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
if(isset($_POST['name']) && isset($_POST['comment'])){
|
32
|
+
|
33
|
+
$name=$_POST['name'];
|
34
|
+
|
35
|
+
$comment=$_POST['comment'];
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
$fp=fopen($file, 'a+');
|
40
|
+
|
41
|
+
$date=date('Y-m-d');
|
42
|
+
|
43
|
+
$context="<>" . $name . "<>" . $comment . "<>" . $date;
|
44
|
+
|
45
|
+
$count =1;
|
46
|
+
|
47
|
+
while(fgets($fp)!=false){
|
48
|
+
|
49
|
+
$count++;
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
fwrite($fp, $count. $context.PHP_EOL);
|
54
|
+
|
55
|
+
flock($fp, LOCK_UN);
|
56
|
+
|
57
|
+
fclose($fp);
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
//file: return array
|
64
|
+
|
65
|
+
$file_array = file($file);
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
// delete function
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
if(isset($_POST['number'])) {
|
74
|
+
|
75
|
+
$delete=$_POST['number'];
|
76
|
+
|
77
|
+
$delete_num=(int)$delete;
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
$fp= fopen($file, 'w+');
|
82
|
+
|
83
|
+
//count includes "0"
|
84
|
+
|
85
|
+
foreach($file_array as $file_cont) {
|
86
|
+
|
87
|
+
$file_num = explode("<>", $file_cont);
|
88
|
+
|
89
|
+
$num=$file_num[0];
|
90
|
+
|
91
|
+
$name=$file_num[1];
|
92
|
+
|
93
|
+
$comment=$file_num[2];
|
94
|
+
|
95
|
+
$date=$file_num[3];
|
96
|
+
|
97
|
+
if ($num == $delete_num) {
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
}else if($num < $delete_num) {
|
102
|
+
|
103
|
+
fwrite($fp, $num . "<>" . $name . "<>"
|
104
|
+
|
105
|
+
. $comment . "<>" . $date);
|
106
|
+
|
107
|
+
}else{
|
108
|
+
|
109
|
+
$num=$num-1;
|
110
|
+
|
111
|
+
fwrite($fp, $num . "<>" . $name . "<>"
|
112
|
+
|
113
|
+
. $comment . "<>" . $date);
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
}
|
122
|
+
|
123
|
+
fclose( $fp );
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
// edit form
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
if(isset($_POST['edit_button'])){
|
136
|
+
|
137
|
+
for($i=0; $i< count($file_array); $i++){
|
138
|
+
|
139
|
+
$data=explode("<>", $file_array[$i]);
|
140
|
+
|
141
|
+
if($data[0]==($_POST['edit_num'])){
|
142
|
+
|
143
|
+
$simEdit=$data;
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
if(isset($_POST['hidden'])){
|
154
|
+
|
155
|
+
for($j=0; $j<count($file_array); $j++){
|
156
|
+
|
157
|
+
$data2= explode("<>", $file_array[$j]);
|
158
|
+
|
159
|
+
if($data2[0]==($_POST['hidden'])){
|
160
|
+
|
161
|
+
$num=$_POST['hidden'];
|
162
|
+
|
163
|
+
$data2[1]=$_POST['name'];
|
164
|
+
|
165
|
+
$data2[2]=$_POST['comment'];
|
166
|
+
|
167
|
+
$file_array[$j]=implode("<>", $data2);
|
168
|
+
|
169
|
+
file_put_contents($file, implode("", $file_array));
|
170
|
+
|
171
|
+
}
|
172
|
+
|
173
|
+
}
|
174
|
+
|
175
|
+
}
|
176
|
+
|
177
|
+
?>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<html>
|
182
|
+
|
183
|
+
<head>
|
184
|
+
|
185
|
+
<title>Kadai2</title>
|
186
|
+
|
187
|
+
</head>
|
188
|
+
|
189
|
+
<h1>Brief board system</h1><br>
|
190
|
+
|
191
|
+
<h2>Register form</h2>
|
192
|
+
|
193
|
+
<form action="" method="post">
|
194
|
+
|
195
|
+
Name:
|
196
|
+
|
197
|
+
<input type="text" name="name" value="<?php if(!empty($_POST['edit_num'])){
|
198
|
+
|
199
|
+
echo $_POST['name'];}?>"><br>
|
200
|
+
|
201
|
+
Comment:
|
202
|
+
|
203
|
+
<input type="text" name="comment" value="<?php if(!empty($_POST['edit_num'])){
|
204
|
+
|
205
|
+
echo $_POST['comment'];}?>"><br><br>
|
206
|
+
|
207
|
+
<input type="submit" name="submit" value="Submit"><br><br>
|
208
|
+
|
209
|
+
<input type="hidden" name="hidden" value="<?php echo ($_POST['edit_num']);?>">
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
</form>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<h2>Delete form</h2>
|
220
|
+
|
221
|
+
<form action="" method="post">
|
222
|
+
|
223
|
+
Delete number:
|
224
|
+
|
225
|
+
<input type="text" name="number"><br><br>
|
226
|
+
|
227
|
+
<input type="submit" value="Delete"><br><br>
|
228
|
+
|
229
|
+
</form>
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<h2>Edit form</h2>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
<form action="" method="post">
|
238
|
+
|
239
|
+
Edit number:
|
240
|
+
|
241
|
+
<input type="text" name="edit_num"><br><br>
|
242
|
+
|
243
|
+
<input type="submit" name="edit_button" value="Edit"><br><br>
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</form>
|
250
|
+
|
251
|
+
<h3>Below the Registered context</h3>
|
252
|
+
|
253
|
+
<body>
|
254
|
+
|
19
255
|
|
20
256
|
|
21
257
|
<?php
|
22
258
|
|
23
259
|
|
24
260
|
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
25
|
-
$file
|
265
|
+
$file_name="kadai2_2.txt";
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
266
|
+
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
if(isset($_POST['name']) && isset($_POST['comment'])){
|
34
|
-
|
35
|
-
$name=$_POST['name'];
|
36
|
-
|
37
|
-
$comment=$_POST['comment'];
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
$fp=fopen($file, 'a+');
|
42
|
-
|
43
|
-
$date=date('Y-m-d');
|
44
|
-
|
45
|
-
$context="<>" . $name . "<>" . $comment . "<>" . $date;
|
46
|
-
|
47
|
-
$count =1;
|
48
|
-
|
49
|
-
while(fgets($fp)!=false){
|
50
|
-
|
51
|
-
$count++;
|
52
|
-
|
53
|
-
}
|
54
|
-
|
55
|
-
fwrite($fp, $count. $context.PHP_EOL);
|
56
|
-
|
57
|
-
flock($fp, LOCK_UN);
|
58
|
-
|
59
|
-
fclose($fp);
|
60
|
-
|
61
|
-
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
//file: return array
|
66
|
-
|
67
|
-
$file
|
267
|
+
$file = file($file_name);
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
268
|
+
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
269
|
+
|
76
|
-
|
77
|
-
|
270
|
+
|
78
|
-
|
79
|
-
$delete_num=(int)$delete;
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
$fp= fopen($file, 'w+');
|
84
|
-
|
85
|
-
//count includes "0"
|
86
|
-
|
87
|
-
|
271
|
+
foreach($file as $input){
|
88
|
-
|
272
|
+
|
89
|
-
|
273
|
+
$division =explode("<>", $input);
|
90
|
-
|
91
|
-
|
274
|
+
|
92
|
-
|
93
|
-
$name=$file_num[1];
|
94
|
-
|
95
|
-
$comment=$file_num[2];
|
96
|
-
|
97
|
-
$date=$file_num[3];
|
98
|
-
|
99
|
-
if ($num == $delete_num) {
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
275
|
+
foreach($division as $display) {
|
104
|
-
|
105
|
-
|
276
|
+
|
106
|
-
|
107
|
-
|
277
|
+
echo $display . "<br/>";
|
108
|
-
|
109
|
-
}else{
|
110
|
-
|
111
|
-
$num=$num-1;
|
112
|
-
|
113
|
-
fwrite($fp, $num . "<>" . $name . "<>"
|
114
|
-
|
115
|
-
. $comment . "<>" . $date);
|
116
|
-
|
117
|
-
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
}
|
124
|
-
|
125
|
-
fclose( $fp );
|
126
|
-
|
127
|
-
}
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
// edit form
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
if(isset($_POST['edit_button'])){
|
138
|
-
|
139
|
-
for($i=0; $i< count($file_array); $i++){
|
140
|
-
|
141
|
-
$data=explode("<>", $file_array[$i]);
|
142
|
-
|
143
|
-
if($data[0]==($_POST['edit_num'])){
|
144
|
-
|
145
|
-
$simEdit=$data;
|
146
|
-
|
147
|
-
}
|
148
278
|
|
149
279
|
}
|
150
280
|
|
@@ -152,142 +282,12 @@
|
|
152
282
|
|
153
283
|
|
154
284
|
|
155
|
-
if(isset($_POST['hidden'])){
|
156
|
-
|
157
|
-
for($j=0; $j<count($file_array); $j++){
|
158
|
-
|
159
|
-
$data2= explode("<>", $file_array[$j]);
|
160
|
-
|
161
|
-
if($data2[0]==($_POST['hidden'])){
|
162
|
-
|
163
|
-
$num=$_POST['hidden'];
|
164
|
-
|
165
|
-
$data2[1]=$_POST['name'];
|
166
|
-
|
167
|
-
$data2[2]=$_POST['comment'];
|
168
|
-
|
169
|
-
$file_array[$j]=implode("<>", $data2);
|
170
|
-
|
171
|
-
file_put_contents($file, implode("", $file_array));
|
172
|
-
|
173
|
-
}
|
174
|
-
|
175
|
-
}
|
176
|
-
|
177
|
-
}
|
178
|
-
|
179
285
|
?>
|
180
286
|
|
181
287
|
|
182
288
|
|
183
|
-
<html>
|
184
|
-
|
185
|
-
<head>
|
186
|
-
|
187
|
-
<title>Kadai2</title>
|
188
|
-
|
189
|
-
</head>
|
190
|
-
|
191
|
-
<h1>Brief board system</h1><br>
|
192
|
-
|
193
|
-
<h2>Register form</h2>
|
194
|
-
|
195
|
-
<form action="" method="post">
|
196
|
-
|
197
|
-
Name:
|
198
|
-
|
199
|
-
<input type="text" name="name" value="<?php if(!empty($_POST['edit_num'])){
|
200
|
-
|
201
|
-
echo $_POST['name'];}?>"><br>
|
202
|
-
|
203
|
-
Comment:
|
204
|
-
|
205
|
-
<input type="text" name="comment" value="<?php if(!empty($_POST['edit_num'])){
|
206
|
-
|
207
|
-
echo $_POST['comment'];}?>"><br><br>
|
208
|
-
|
209
|
-
<input type="submit" name="submit" value="Submit"><br><br>
|
210
|
-
|
211
|
-
<input type="hidden" name="hidden" value="<?php echo ($_POST['edit_num']);?>">
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
</form>
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
<h2>Delete form</h2>
|
222
|
-
|
223
|
-
<form action="" method="post">
|
224
|
-
|
225
|
-
Delete number:
|
226
|
-
|
227
|
-
<input type="text" name="number"><br><br>
|
228
|
-
|
229
|
-
<input type="submit" value="Delete"><br><br>
|
230
|
-
|
231
|
-
</form>
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
<h2>Edit form</h2>
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
<form action="" method="post">
|
240
|
-
|
241
|
-
Edit number:
|
242
|
-
|
243
|
-
<input type="text" name="edit_num"><br><br>
|
244
|
-
|
245
|
-
<input type="submit" name="edit_button" value="Edit"><br><br>
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
</form>
|
252
|
-
|
253
|
-
<h3>Below the Registered context</h3>
|
254
|
-
|
255
|
-
<body>
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
<?php
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
$file_name="kadai2_2.txt";
|
268
|
-
|
269
|
-
$file = file($file_name);
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
foreach($file as $input){
|
274
|
-
|
275
|
-
$division =explode("<>", $input);
|
276
|
-
|
277
|
-
foreach($division as $display) {
|
278
|
-
|
279
|
-
echo $display . "<br/>";
|
280
|
-
|
281
|
-
}
|
282
|
-
|
283
|
-
}
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
?>
|
288
|
-
|
289
|
-
|
290
|
-
|
291
289
|
</body>
|
292
290
|
|
293
291
|
</html>
|
292
|
+
|
293
|
+
```
|
2
リンク追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,6 +10,12 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
+
以下のコードは見にくいと思うので以下のURLを参照いただけると幸いです。
|
14
|
+
|
15
|
+
リンク
|
16
|
+
|
17
|
+
https://harigami.net/cd?hsh=3305e95d-0cd9-4021-a098-1a1534fec9ee
|
18
|
+
|
13
19
|
|
14
20
|
|
15
21
|
<?php
|
1
markdown
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
+
|
14
|
+
|
13
15
|
<?php
|
14
16
|
|
15
17
|
|
@@ -34,9 +36,7 @@
|
|
34
36
|
|
35
37
|
$date=date('Y-m-d');
|
36
38
|
|
37
|
-
$context="<>" . $name . "<>"
|
39
|
+
$context="<>" . $name . "<>" . $comment . "<>" . $date;
|
38
|
-
|
39
|
-
. $comment . "<>" . $date;
|
40
40
|
|
41
41
|
$count =1;
|
42
42
|
|