質問編集履歴
1
ソースコードをファイルごとに分けました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,433 +1,509 @@
|
|
1
|
+
### 前提・実現したいこと
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
エラーの解決方法がわかりません。
|
6
|
+
|
7
|
+
|
8
|
+
|
1
|
-
|
9
|
+
### 発生している問題・エラーメッセージ
|
10
|
+
|
11
|
+
|
12
|
+
|
2
|
-
|
13
|
+
```
|
14
|
+
|
3
|
-
|
15
|
+
Parse error: syntax error, unexpected end of file in /Applications/MAMP/htdocs/nampa_game/index.php on line 203
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
16
|
+
|
8
|
-
|
9
|
-
|
17
|
+
```
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
18
|
+
|
19
|
+
|
20
|
+
|
15
|
-
|
21
|
+
### 該当のソースコード
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
```ここに言語名を入力
|
16
26
|
|
17
27
|
<?php
|
18
28
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
debug
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
debug
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
29
|
+
ini_set('log_errors','on');
|
30
|
+
|
31
|
+
ini_set('error_log','php.log');
|
32
|
+
|
33
|
+
session_start();
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
// デバッグフラグ
|
38
|
+
|
39
|
+
$debug_flg = true;
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
function debug($str){
|
44
|
+
|
45
|
+
global $debug_flg;
|
46
|
+
|
47
|
+
if($debug_flg){
|
48
|
+
|
49
|
+
error_log('デバッグ:'.$str);
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
// エラーメッセージ
|
58
|
+
|
59
|
+
define('NONAME','なまえが入力されていません。');
|
60
|
+
|
61
|
+
define('NOAGE','ねんれいが入力されていません。');
|
62
|
+
|
63
|
+
define('REAGE','正しく入力してください');
|
64
|
+
|
65
|
+
define('MAXLEN','6文字以内で入力してください');
|
66
|
+
|
67
|
+
define('HALF','半角で入力してください');
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
// エラーメッセージ格納用
|
74
|
+
|
75
|
+
$err_msg = array();
|
76
|
+
|
77
|
+
// 女の子格納用
|
78
|
+
|
79
|
+
$womans = array();
|
80
|
+
|
81
|
+
// 男のセリフクラス
|
82
|
+
|
83
|
+
class Serif{
|
84
|
+
|
85
|
+
const EAT = 1;
|
86
|
+
|
87
|
+
const PARK = 2;
|
88
|
+
|
89
|
+
const MOVIE = 3;
|
90
|
+
|
91
|
+
const HOTEL = 4;
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
// 女の返事クラス( ○ )
|
96
|
+
|
97
|
+
class ReplyOk{
|
98
|
+
|
99
|
+
const EAT = '行きましょ!何食べよっかな〜(*´꒳`*)';
|
100
|
+
|
101
|
+
const PARK= '行く行く!どこの遊園地行こうかな〜(*´꒳`*)';
|
102
|
+
|
103
|
+
const MOVIE= '行きたい!ちょうど見たい映画あったんだよね〜(*´꒳`*)';
|
104
|
+
|
105
|
+
const HOTEL= 'うん。行きましょ❤️';
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
//男の喜びクラス
|
110
|
+
|
111
|
+
class Happy{
|
112
|
+
|
113
|
+
const EAT = 'なんでもいいよ!全部おごるよー!';
|
114
|
+
|
115
|
+
const PARK= 'どこでもいいよ!行きたいところ連れてくよ!';
|
116
|
+
|
117
|
+
const MOVIE= 'おっ!じゃあそれ見に行こ〜';
|
118
|
+
|
119
|
+
const HOTEL= 'あそこにホテルあるね!早く行こ!';
|
120
|
+
|
121
|
+
}
|
122
|
+
|
123
|
+
// 女の返事クラス( ✖️ )
|
124
|
+
|
125
|
+
class ReplyNo{
|
126
|
+
|
127
|
+
const EAT = '一緒にご飯?行くわけないでしょ!!さよなら。';
|
128
|
+
|
129
|
+
const PARK= '一緒に遊園地?一人で行ってこい!!さよなら。';
|
130
|
+
|
131
|
+
const MOVIE= '映画館?映画見る気分じゃないんだけどー。さよなら。';
|
132
|
+
|
133
|
+
const HOTEL= 'ホテル!?気持ち悪っ!さよなら。';
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
// 男の悲しみクラス
|
138
|
+
|
139
|
+
class Sad{
|
140
|
+
|
141
|
+
const EAT = 'ご飯くらい行ってくれてもいいじゃん。。。泣';
|
142
|
+
|
143
|
+
const PARK= 'ひっ、一人では行きたくないよ。。。泣';
|
144
|
+
|
145
|
+
const MOVIE= '行きたくないだけじゃん。。。泣';
|
146
|
+
|
147
|
+
const HOTEL= 'さすがにホテルは無理か。。。泣';
|
148
|
+
|
149
|
+
}
|
150
|
+
|
151
|
+
// 抽象クラス(人クラス)
|
152
|
+
|
153
|
+
abstract class Human{
|
154
|
+
|
155
|
+
protected $name;
|
156
|
+
|
157
|
+
protected $img;
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
public function __construct($name, $age, $img){
|
162
|
+
|
163
|
+
$this->name = $name;
|
164
|
+
|
165
|
+
$this->img = $img;
|
166
|
+
|
167
|
+
$this->age = $age;
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
public function setName($str){
|
174
|
+
|
175
|
+
$this->name = $str;
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
public function getName(){
|
180
|
+
|
181
|
+
return $this->name;
|
182
|
+
|
183
|
+
}
|
184
|
+
|
185
|
+
public function setAge($num){
|
186
|
+
|
187
|
+
$this->age = $num;
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
public function getAge(){
|
192
|
+
|
193
|
+
return $this->age;
|
194
|
+
|
195
|
+
}
|
196
|
+
|
197
|
+
public function getImg(){
|
198
|
+
|
199
|
+
return $this->img;
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
// 主人公クラス
|
208
|
+
|
209
|
+
class Hero extends Human{
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
public function __construct($name, $age, $img){
|
214
|
+
|
215
|
+
parent::__construct($name, $age, $img);
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
public function attack($targetWoman, $method){
|
220
|
+
|
221
|
+
switch($method){
|
222
|
+
|
223
|
+
case Serif::EAT :
|
224
|
+
|
225
|
+
History::set($this->getName().':'.$targetWoman->getName().'ちゃーん、一緒にご飯行かないー?' ,2);
|
226
|
+
|
227
|
+
break;
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
case Serif::PARK :
|
232
|
+
|
233
|
+
History::set($this->getName().':'.$targetWoman->getName().'ちゃーん、一緒に遊園地行かないー?' ,2);
|
234
|
+
|
235
|
+
break;
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
case Serif::MOVIE :
|
240
|
+
|
241
|
+
History::set($this->getName().':'.$targetWoman->getName().'ちゃーん、一緒に映画行かないー?' ,2);
|
242
|
+
|
243
|
+
break;
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
case Serif::HOTEL :
|
248
|
+
|
249
|
+
History::set($this->getName().':'.$targetWoman->getName().'ちゃーん、一緒にホテル行かないー?' ,2);
|
250
|
+
|
251
|
+
break;
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
}
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
// 女クラス
|
262
|
+
|
263
|
+
class Woman extends Human{
|
264
|
+
|
265
|
+
private $level;
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
public function __construct($name, $age, $img, $level){
|
270
|
+
|
271
|
+
parent::__construct($name, $age, $img);
|
272
|
+
|
273
|
+
$this->level = $level;
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
public function getLevel(){
|
278
|
+
|
279
|
+
return $this->level;
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
public function Reply($targetMan, $method){
|
284
|
+
|
285
|
+
switch($method){
|
286
|
+
|
287
|
+
case Serif::EAT :
|
288
|
+
|
289
|
+
if(!mt_rand(0, $this->getLevel())){
|
290
|
+
|
291
|
+
History::set($this->getName().':'.ReplyOk::EAT, 3);
|
292
|
+
|
293
|
+
History::set($targetMan->getName().':'.Happy::EAT, 4);
|
294
|
+
|
295
|
+
$_SESSION['success'] += 1;
|
296
|
+
|
297
|
+
} else {
|
298
|
+
|
299
|
+
History::set($this->getName().':'.ReplyNo::EAT, 3);
|
300
|
+
|
301
|
+
History::set($targetMan->getName().':'.Sad::EAT, 4);
|
78
302
|
|
79
303
|
}
|
80
304
|
|
305
|
+
break;
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
case Serif::PARK :
|
310
|
+
|
311
|
+
if(!mt_rand(0, $this->getLevel() * 5)){
|
312
|
+
|
81
|
-
|
313
|
+
History::set($this->getName().':'.ReplyOk::PARK, 3);
|
314
|
+
|
315
|
+
History::set($targetMan->getName().':'.appy::PARK, 4);
|
316
|
+
|
317
|
+
$_SESSION['success'] += 1;
|
318
|
+
|
319
|
+
} else {
|
320
|
+
|
321
|
+
History::set($this->getName().':'.ReplyNo::PARK, 3);
|
322
|
+
|
323
|
+
History::set($targetMan->getName().':'.Sad::PARK, 4);
|
324
|
+
|
325
|
+
}
|
326
|
+
|
327
|
+
break;
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
case Serif::MOVIE :
|
332
|
+
|
333
|
+
if(!mt_rand(0, $tzhis->getLevel() * 3)){
|
334
|
+
|
335
|
+
History::set($this->getName().':'.ReplyOk::MOVIE, 3);
|
336
|
+
|
337
|
+
History::set($targetMan->getName().':'.Happy::MOVIE, 4);
|
338
|
+
|
339
|
+
$_SESSION['success'] += 1;
|
340
|
+
|
341
|
+
} else {
|
342
|
+
|
343
|
+
History::set($this->getName().':'.ReplyNo::MOVIE, 3);
|
344
|
+
|
345
|
+
History::set($targetMan->getName().':'.Sad::MOVIE, 4);
|
346
|
+
|
347
|
+
}
|
348
|
+
|
349
|
+
break;
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
case Serif::HOTEL :
|
354
|
+
|
355
|
+
if(!mt_rand(0, $this->getLevel() * 10)){
|
356
|
+
|
357
|
+
History::set($this->getName().':'.ReplyOk::HOTEL, 3);
|
358
|
+
|
359
|
+
History::set($targetMan->getName().':'.Happy::HOTEL, 4);
|
360
|
+
|
361
|
+
$_SESSION['success'] += 1;
|
362
|
+
|
363
|
+
} else {
|
364
|
+
|
365
|
+
History::set($this->getName().':'.ReplyNo::HOTEL, 3);
|
366
|
+
|
367
|
+
History::set($targetMan->getName().':'.Sad::HOTEL, 4);
|
368
|
+
|
369
|
+
}
|
370
|
+
|
371
|
+
break;
|
82
372
|
|
83
373
|
}
|
84
374
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
}
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
}
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
debug('画面表示処理終了。');
|
375
|
+
}
|
376
|
+
|
377
|
+
}
|
378
|
+
|
379
|
+
// インターフェース
|
380
|
+
|
381
|
+
interface HistoryInterface{
|
382
|
+
|
383
|
+
public static function set($str, $num);
|
384
|
+
|
385
|
+
public static function clear();
|
386
|
+
|
387
|
+
}
|
388
|
+
|
389
|
+
// 履歴管理用クラス
|
390
|
+
|
391
|
+
class History implements HistoryInterface{
|
392
|
+
|
393
|
+
public static function set($str, $num){
|
394
|
+
|
395
|
+
if(empty($_SESSION['history'])) $_SESSION['history'] = '';
|
396
|
+
|
397
|
+
$_SESSION['history'][$num] = $str;
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
}
|
402
|
+
|
403
|
+
public static function clear(){
|
404
|
+
|
405
|
+
unset($_SESSION['history']);
|
406
|
+
|
407
|
+
}
|
408
|
+
|
409
|
+
}
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
// インスタンス生成
|
414
|
+
|
415
|
+
$man = new Hero('','','img/mon.jpg');
|
416
|
+
|
417
|
+
$womans[] = new Woman('けいこ',(int)mt_rand(20,35),'img/keiko.jpg',(int)mt_rand(1,100));
|
418
|
+
|
419
|
+
$womans[] = new Woman('のぞみ',(int)mt_rand(20,35),'img/nozomi.jpg',(int)mt_rand(1,100));
|
420
|
+
|
421
|
+
$womans[] = new Woman('かすみ',(int)mt_rand(20,35),'img/kasumi.jpg',(int)mt_rand(1,100));
|
422
|
+
|
423
|
+
$womans[] = new Woman('すず',(int)mt_rand(20,35),'img/suzu.jpg',(int)mt_rand(1,100));
|
424
|
+
|
425
|
+
$womans[] = new Woman('まさみ',(int)mt_rand(20,35),'img/masami.jpg',(int)mt_rand(1,100));
|
426
|
+
|
427
|
+
$womans[] = new Woman('さとみ',(int)mt_rand(20,35),'img/satomi.jpg',(int)mt_rand(1,100));
|
428
|
+
|
429
|
+
$womans[] = new Woman('ゆい',(int)mt_rand(20,35),'img/yui.jpg',(int)mt_rand(1,100));
|
430
|
+
|
431
|
+
$womans[] = new Woman('みれい',(int)mt_rand(20,35),'img/mirei.jpg',(int)mt_rand(1,100));
|
432
|
+
|
433
|
+
$womans[] = new Woman('たお',(int)mt_rand(20,35),'img/tao.png',(int)mt_rand(1,100));
|
434
|
+
|
435
|
+
$womans[] = new Woman('つばさ',(int)mt_rand(20,35),'img/tubasa.jpg',(int)mt_rand(1,100));
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
function createWoman(){
|
440
|
+
|
441
|
+
global $womans;
|
442
|
+
|
443
|
+
$woman = $womans[mt_rand(0,9)];
|
444
|
+
|
445
|
+
History::set($woman->getName().'が歩いているよ!', 0);
|
446
|
+
|
447
|
+
History::set('どうする?', 1);
|
448
|
+
|
449
|
+
$_SESSION['woman'] = $woman;
|
450
|
+
|
451
|
+
}
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
function createMan(){
|
456
|
+
|
457
|
+
global $man;
|
458
|
+
|
459
|
+
$_SESSION['man'] = $man;
|
460
|
+
|
461
|
+
}
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
function init(){
|
466
|
+
|
467
|
+
History::clear();
|
468
|
+
|
469
|
+
$_SESSION['count'] = 10;
|
470
|
+
|
471
|
+
$_SESSION['success'] = 0;
|
472
|
+
|
473
|
+
createMan();
|
474
|
+
|
475
|
+
createWoman();
|
476
|
+
|
477
|
+
}
|
478
|
+
|
479
|
+
function gameOver(){
|
480
|
+
|
481
|
+
$_SESSION = array();
|
482
|
+
|
483
|
+
$_POST = array();
|
484
|
+
|
485
|
+
}
|
206
486
|
|
207
487
|
?>
|
208
488
|
|
209
489
|
|
210
490
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
<p>Level : <?php $_SESSION['woman']->getLevel(); ?></p>
|
232
|
-
|
233
|
-
</div>
|
234
|
-
|
235
|
-
<div class="woman-prof-triangle"></div>
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
<div class="woman-img">
|
240
|
-
|
241
|
-
<img src="<?php $_SESSION['woman']->getImg(); ?>" alt="">
|
242
|
-
|
243
|
-
</div>
|
244
|
-
|
245
|
-
</div>
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
<!-- 主人公 -->
|
250
|
-
|
251
|
-
<div class="man">
|
252
|
-
|
253
|
-
<div class="man-img">
|
254
|
-
|
255
|
-
<img src="<?php $_SESSION['man']->getImg(); ?>" alt="">
|
256
|
-
|
257
|
-
</div>
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
<div class="man-prof-triangle"></div>
|
262
|
-
|
263
|
-
<div class="man-prof">
|
264
|
-
|
265
|
-
<p><?php $_SESSION['man']->getName(); ?> <?php $_SESSION['man']->getAge(); ?>才</p>
|
266
|
-
|
267
|
-
<p>残り:<?php $_SESSION['count']; ?> 回 成功回数:<?php $_SESSION['success']; ?>回</p>
|
268
|
-
|
269
|
-
</div>
|
270
|
-
|
271
|
-
</div>
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
<!-- テキスト画面 -->
|
276
|
-
|
277
|
-
<?php if(!$attack): ?>
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
<form method="post" class="text-area">
|
282
|
-
|
283
|
-
<div class="text-area-top">
|
284
|
-
|
285
|
-
<div class="text-four"style="padding-left:30px; box-sizing:border-box;">
|
286
|
-
|
287
|
-
<p><?php echo $_SESSION['history'][0]; ?></p>
|
288
|
-
|
289
|
-
</div>
|
290
|
-
|
291
|
-
<div class="text-four" style="padding-left:30px; box-sizing:border-box;">
|
292
|
-
|
293
|
-
<input type="submit" name="attack" value=" ナンパする" id="js-arrow-attack">
|
294
|
-
|
295
|
-
</div>
|
296
|
-
|
297
|
-
</div>
|
298
|
-
|
299
|
-
<div class="text-area-bottom">
|
300
|
-
|
301
|
-
<div class="text-four"style="padding-left:30px; box-sizing:border-box;">
|
302
|
-
|
303
|
-
<p><?php echo $_SESSION['history'][1]; ?></p>
|
304
|
-
|
305
|
-
</div>
|
306
|
-
|
307
|
-
<div class="text-four" style="padding-left:30px; box-sizing:border-box;">
|
308
|
-
|
309
|
-
<input type="submit" name="escape" value=" 別の子にする" id="js-arrow-escape">
|
310
|
-
|
311
|
-
</div>
|
312
|
-
|
313
|
-
</div>
|
314
|
-
|
315
|
-
</form>
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
<?php elseif(!empty($_SESSION['history'][0]) && !empty($_SESSION['history'][1])): ?>
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
<form method="post" class="text-area">
|
324
|
-
|
325
|
-
<div class="text-area-top">
|
326
|
-
|
327
|
-
<div class="text-four" style="padding-left:30px; box-sizing:border-box;">
|
328
|
-
|
329
|
-
<input type="submit" name="eat" value=" ご飯に誘う" id="js-arrow-eat">
|
330
|
-
|
331
|
-
</div>
|
332
|
-
|
333
|
-
<div class="text-four" style="padding-left:30px; box-sizing:border-box;">
|
334
|
-
|
335
|
-
<input type="submit" name="park" value=" 遊園地に誘う" id="js-arrow-park">
|
336
|
-
|
337
|
-
</div>
|
338
|
-
|
339
|
-
</div>
|
340
|
-
|
341
|
-
<div class="text-area-bottom">
|
342
|
-
|
343
|
-
<div class="text-four" style="padding-left:30px; box-sizing:border-box;">
|
344
|
-
|
345
|
-
<input type="submit" name="movie" value=" 映画に誘う" id="js-arrow-movie">
|
346
|
-
|
347
|
-
</div>
|
348
|
-
|
349
|
-
<div class="text-four" style="padding-left:30px; box-sizing:border-box;">
|
350
|
-
|
351
|
-
<input type="submit" name="hotel" value=" ホテルに誘う" id="js-arrow-hotel">
|
352
|
-
|
353
|
-
</div>
|
354
|
-
|
355
|
-
</div>
|
356
|
-
|
357
|
-
</form>
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
<?php elseif(!empty($_SESSION['history'][2]) && empty($_SESSION['history'][3])): ?>
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
<form method="post" class="text-area">
|
366
|
-
|
367
|
-
<input type="submit" name="next1" value="" class="arrow-next">
|
368
|
-
|
369
|
-
<div class="text-area-top">
|
370
|
-
|
371
|
-
<p><?php echo $_SESSION['history'][2]; ?></p>
|
372
|
-
|
373
|
-
</div>
|
374
|
-
|
375
|
-
<div class="text-area-bottom">
|
376
|
-
|
377
|
-
<span class="js-arrow-next">▼</span>
|
378
|
-
|
379
|
-
</div>
|
380
|
-
|
381
|
-
</form>
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
<?php elseif(!empty($_SESSION['history'][3]) && !empty($_SESSION['history'][4])): ?>
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
<form method="post" class="text-area">
|
390
|
-
|
391
|
-
<input type="submit" name="next2" value="" class="arrow-next">
|
392
|
-
|
393
|
-
<div class="text-area-top">
|
394
|
-
|
395
|
-
<p><?php echo $_SESSION['history'][3]; ?></p>
|
396
|
-
|
397
|
-
</div>
|
398
|
-
|
399
|
-
<div class="text-area-bottom">
|
400
|
-
|
401
|
-
<p><?php echo $_SESSION['history'][4]; ?></p>
|
402
|
-
|
403
|
-
<span class="js-arrow-next">▼</span>
|
404
|
-
|
405
|
-
</div>
|
406
|
-
|
407
|
-
</form>
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
<?php endif; ?>
|
412
|
-
|
413
|
-
</div>
|
414
|
-
|
415
|
-
</main>
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
<?php require('footer.php'); ?>
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
※補足
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
203行目は一番下の
|
432
|
-
|
433
|
-
「<?php require('footer.php'); ?>」です。
|
491
|
+
```
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
### 試したこと
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
エラーメッセージにあるように203行付近の誤字脱字を確認しましたが、わかりませんでした。
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
### 補足情報(FW/ツールのバージョンなど)
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
PHP 7.1.33(最新のバージョンだと思います。)
|
508
|
+
|
509
|
+
common.php, head.php, footer.phpも必要であれば追加します。(おそらく誤字脱字だと思うので今は載せてありません)
|