質問編集履歴
6
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -366,6 +366,10 @@
|
|
366
366
|
|
367
367
|
<?php
|
368
368
|
|
369
|
+
header("location: registration.php");
|
370
|
+
|
371
|
+
exit;
|
372
|
+
|
369
373
|
session_start();
|
370
374
|
|
371
375
|
|
@@ -556,9 +560,7 @@
|
|
556
560
|
|
557
561
|
|
558
562
|
|
559
|
-
|
563
|
+
|
560
|
-
|
561
|
-
exit;
|
562
564
|
|
563
565
|
|
564
566
|
|
5
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
-
・registration.php(新規登録フォーム)
|
21
|
+
・registration.php(新規登録フォーム)
|
22
22
|
|
23
23
|
```php
|
24
24
|
|
4
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -366,8 +366,6 @@
|
|
366
366
|
|
367
367
|
<?php
|
368
368
|
|
369
|
-
header("location: registration.php");
|
370
|
-
|
371
369
|
session_start();
|
372
370
|
|
373
371
|
|
@@ -396,9 +394,9 @@
|
|
396
394
|
|
397
395
|
// POST で受けたキー値と同名の変数に値を代入(可変変数)
|
398
396
|
|
399
|
-
foreach($keys as $key) {
|
397
|
+
foreach ($keys as $key) {
|
400
|
-
|
398
|
+
|
401
|
-
$$key = $_POST[$key];
|
399
|
+
${$key} = $_POST[$key];
|
402
400
|
|
403
401
|
}
|
404
402
|
|
@@ -414,7 +412,7 @@
|
|
414
412
|
|
415
413
|
// エラーメッセージの配列の初期化
|
416
414
|
|
417
|
-
$errorMsg = array();
|
415
|
+
$_SESSION['errorMsg'] = array();
|
418
416
|
|
419
417
|
|
420
418
|
|
@@ -422,7 +420,7 @@
|
|
422
420
|
|
423
421
|
if (empty($name)) {
|
424
422
|
|
425
|
-
$errorMsg[] = "名前を入力してください。";
|
423
|
+
$errorMsg[] = "名前を入力してください。";
|
426
424
|
|
427
425
|
}
|
428
426
|
|
@@ -432,7 +430,7 @@
|
|
432
430
|
|
433
431
|
if (empty($email)) {
|
434
432
|
|
435
|
-
$errorMsg[] = "メールアドレスを入力してください。";
|
433
|
+
$errorMsg[] = "メールアドレスを入力してください。";
|
436
434
|
|
437
435
|
}
|
438
436
|
|
@@ -442,7 +440,7 @@
|
|
442
440
|
|
443
441
|
if (empty($password)) {
|
444
442
|
|
445
|
-
$errorMsg[] = "パスワードを入力してください。";
|
443
|
+
$errorMsg[] = "パスワードを入力してください。";
|
446
444
|
|
447
445
|
}
|
448
446
|
|
@@ -452,7 +450,7 @@
|
|
452
450
|
|
453
451
|
if (empty($tel)) {
|
454
452
|
|
455
|
-
$errorMsg[] = "電話番号を入力してください。";
|
453
|
+
$errorMsg[] = "電話番号を入力してください。";
|
456
454
|
|
457
455
|
}
|
458
456
|
|
@@ -462,7 +460,7 @@
|
|
462
460
|
|
463
461
|
if ($prefectures == "選択") {
|
464
462
|
|
465
|
-
$errorMsg[] = "都道府県を選択してください。";
|
463
|
+
$errorMsg[] = "都道府県を選択してください。";
|
466
464
|
|
467
465
|
}
|
468
466
|
|
@@ -476,11 +474,21 @@
|
|
476
474
|
|
477
475
|
|
478
476
|
|
477
|
+
// 名前の文字数チェック
|
478
|
+
|
479
|
+
if (strlen($name) >= 30) {
|
480
|
+
|
481
|
+
$errorMsg[] = "氏名が長すぎます。";
|
482
|
+
|
483
|
+
}
|
484
|
+
|
485
|
+
|
486
|
+
|
479
487
|
// パスワード文字数チェック(8文字以上か)
|
480
488
|
|
481
489
|
if (preg_match("/^[a-zA-Z1-9]{1,7}$/", $password)) {
|
482
490
|
|
483
|
-
$errorMsg[] = "パスワードは8文字以上で入力してください。";
|
491
|
+
$errorMsg[] = "パスワードは8文字以上で入力してください。";
|
484
492
|
|
485
493
|
}
|
486
494
|
|
@@ -490,16 +498,30 @@
|
|
490
498
|
|
491
499
|
if (strlen($tel) >= 1 && strlen($tel) <= 9) {
|
492
500
|
|
493
|
-
$errorMsg[] = "電話番号は10文字か11文字で入力してください。";
|
501
|
+
$errorMsg[] = "電話番号は10文字か11文字で入力してください。";
|
494
502
|
|
495
503
|
} elseif (strlen($tel) >= 12) {
|
496
504
|
|
497
|
-
$errorMsg[] = "電話番号は10文字か11文字で入力してください。";
|
505
|
+
$errorMsg[] = "電話番号は10文字か11文字で入力してください。";
|
498
506
|
|
499
507
|
}
|
500
508
|
|
501
509
|
|
502
510
|
|
511
|
+
//
|
512
|
+
|
513
|
+
// 形式チェック
|
514
|
+
|
515
|
+
//
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
// メールアドレス形式チェック
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
|
503
525
|
// 電話番号の形式チェック
|
504
526
|
|
505
527
|
if (preg_match("/[0-9]{2,3}-[0-9]{4}-[0-9]{4}/", $tel)) {
|
@@ -524,25 +546,27 @@
|
|
524
546
|
|
525
547
|
if (count($errorMsg) >= 1) {
|
526
548
|
|
527
|
-
$_SESSION['errorMsg'] = $errorMsg;
|
549
|
+
$_SESSION['errorMsg'] = $errorMsg;
|
528
|
-
|
550
|
+
|
529
|
-
foreach ($errorMsg as $error) {
|
551
|
+
foreach ($errorMsg as $error) {
|
530
|
-
|
552
|
+
|
531
|
-
echo $error;
|
553
|
+
echo $error;
|
532
|
-
|
554
|
+
|
533
|
-
}
|
555
|
+
}
|
556
|
+
|
557
|
+
|
558
|
+
|
534
|
-
|
559
|
+
header("location: registration.php");
|
535
|
-
|
536
|
-
|
560
|
+
|
537
|
-
exit
|
561
|
+
exit;
|
538
|
-
|
539
|
-
|
540
|
-
|
562
|
+
|
563
|
+
|
564
|
+
|
541
|
-
} else {
|
565
|
+
} else {
|
542
|
-
|
566
|
+
|
543
|
-
session_destroy();
|
567
|
+
session_destroy();
|
544
|
-
|
568
|
+
|
545
|
-
}
|
569
|
+
}
|
546
570
|
|
547
571
|
|
548
572
|
|
@@ -560,6 +584,86 @@
|
|
560
584
|
|
561
585
|
|
562
586
|
|
587
|
+
<!DOCTYPE html>
|
588
|
+
|
589
|
+
<html lang="ja">
|
590
|
+
|
591
|
+
<head>
|
592
|
+
|
593
|
+
<meta charset="utf-8">
|
594
|
+
|
595
|
+
<title>確認フォーム</title>
|
596
|
+
|
597
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
598
|
+
|
599
|
+
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
600
|
+
|
601
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
</head>
|
606
|
+
|
607
|
+
<body>
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
<form class="form-horizontal" action="#" method="post">
|
614
|
+
|
615
|
+
<fieldset>
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
<!-- Form Name -->
|
620
|
+
|
621
|
+
<legend style=background-color:#65ace4;><h1 style=text-align:center;>確認フォーム</h1></legend>
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
</div>
|
630
|
+
|
631
|
+
</div>
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
</div>
|
644
|
+
|
645
|
+
</fieldset>
|
646
|
+
|
647
|
+
</form>
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
656
|
+
|
657
|
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
658
|
+
|
659
|
+
</body>
|
660
|
+
|
661
|
+
</html>
|
662
|
+
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
563
667
|
```
|
564
668
|
|
565
669
|
|
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,6 +24,8 @@
|
|
24
24
|
|
25
25
|
<?php
|
26
26
|
|
27
|
+
<?php
|
28
|
+
|
27
29
|
session_start();
|
28
30
|
|
29
31
|
|
@@ -44,6 +46,316 @@
|
|
44
46
|
|
45
47
|
|
46
48
|
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
?>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!DOCTYPE html>
|
64
|
+
|
65
|
+
<html lang="ja">
|
66
|
+
|
67
|
+
<head>
|
68
|
+
|
69
|
+
<meta charset="utf-8">
|
70
|
+
|
71
|
+
<title>新規登録フォーム</title>
|
72
|
+
|
73
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
74
|
+
|
75
|
+
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
76
|
+
|
77
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
</head>
|
82
|
+
|
83
|
+
<body>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
<form class="form-horizontal" action="confirm.php" method="post">
|
92
|
+
|
93
|
+
<fieldset>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<!-- Form Name -->
|
98
|
+
|
99
|
+
<legend style=background-color:#65ace4;><h1 style=text-align:center;>新規登録フォーム</h1></legend>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<!-- パンくずリスト-->
|
106
|
+
|
107
|
+
<ol class="breadcrumb">
|
108
|
+
|
109
|
+
<li><a href="http://192.168.33.15"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>トップ</a></li>
|
110
|
+
|
111
|
+
<li class="active">新規登録フォーム</li>
|
112
|
+
|
113
|
+
</ol>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<div class="container">
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<!-- Text input 名前-->
|
124
|
+
|
125
|
+
<div class="form-group" style="margin-top:30px;">
|
126
|
+
|
127
|
+
<label class="col-md-4 control-label" for="name">氏名 <span class="label label-danger">必須</span></label>
|
128
|
+
|
129
|
+
<div class="col-md-4">
|
130
|
+
|
131
|
+
<input name="name" class="form-control input-md" id="name" type="text" placeholder="例:鈴木太郎">
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<!-- Text input メールアドレス-->
|
148
|
+
|
149
|
+
<div class="form-group">
|
150
|
+
|
151
|
+
<label class="col-md-4 control-label" for="email">メールアドレス <span class="label label-danger">必須</span></label>
|
152
|
+
|
153
|
+
<div class="col-md-4">
|
154
|
+
|
155
|
+
<input name="email" class="form-control input-md" id="email" type="email" placeholder="例:suzuki.taro@gmail.com">
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<!-- Text input パスワード-->
|
168
|
+
|
169
|
+
<div class="form-group">
|
170
|
+
|
171
|
+
<label class="col-md-4 control-label" for="password">パスワード <span class="label label-danger">必須</span></label>
|
172
|
+
|
173
|
+
<div class="col-md-4">
|
174
|
+
|
175
|
+
<input name="password" class="form-control input-md" id="password" type="password" placeholder="パスワード">
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
</div>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<!-- Text input 電話番号 -->
|
186
|
+
|
187
|
+
<div class="form-group">
|
188
|
+
|
189
|
+
<label class="col-md-4 control-label" for="tel">電話番号 <span class="label label-danger">必須</span></label>
|
190
|
+
|
191
|
+
<div class="col-md-4">
|
192
|
+
|
193
|
+
<input name="tel" class="form-control input-md" id="tel" type="tel" placeholder="09011112222 ハイフンなし 半角">
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</div>
|
198
|
+
|
199
|
+
</div>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<!-- Select Basic 都道府県 -->
|
204
|
+
|
205
|
+
<div class="form-group">
|
206
|
+
|
207
|
+
<label class="col-md-4 control-label" for="prefectures">都道府県 <span class="label label-danger">必須</span></label>
|
208
|
+
|
209
|
+
<div class="col-md-4">
|
210
|
+
|
211
|
+
<select name="prefectures" class="form-control" id="prefectures">
|
212
|
+
|
213
|
+
<option value="選択">選択</option>
|
214
|
+
|
215
|
+
<option value="東京">東京</option>
|
216
|
+
|
217
|
+
<option value="名古屋">名古屋</option>
|
218
|
+
|
219
|
+
<option value="大阪">大阪</option>
|
220
|
+
|
221
|
+
<option value="その他">その他</option>
|
222
|
+
|
223
|
+
</select>
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
</div>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<!-- インラインチェックボックス 趣味 -->
|
234
|
+
|
235
|
+
<div class="form-group">
|
236
|
+
|
237
|
+
<label class="control-label col-md-4" for="checkbox">趣味 <span class="label label-info">任意</span></label>
|
238
|
+
|
239
|
+
<div class="col-md-4">
|
240
|
+
|
241
|
+
<div class="checkbox">
|
242
|
+
|
243
|
+
<label class="checkbox-inline">
|
244
|
+
|
245
|
+
<input name="hobby[]" type="checkbox" value="野球"> 野球
|
246
|
+
|
247
|
+
</label>
|
248
|
+
|
249
|
+
<label class="checkbox-inline">
|
250
|
+
|
251
|
+
<input name="hobby[]" type="checkbox" value="サッカー"> サッカー
|
252
|
+
|
253
|
+
</label>
|
254
|
+
|
255
|
+
</div>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
</div>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
<!-- インラインラジオボタン 性別 -->
|
268
|
+
|
269
|
+
<div class="form-group">
|
270
|
+
|
271
|
+
<label class="control-label col-md-4" for="checkbox">性別 <span class="label label-info">任意</span></label>
|
272
|
+
|
273
|
+
<div class="col-md-4">
|
274
|
+
|
275
|
+
<div class="radio-inline" name="gender">
|
276
|
+
|
277
|
+
<input name"gender" type="radio" value="男性" name="gender" id="man">男性
|
278
|
+
|
279
|
+
</div>
|
280
|
+
|
281
|
+
<div class="radio-inline">
|
282
|
+
|
283
|
+
<input name"gender" type="radio" value="女性" name="gender" id="woman">女性
|
284
|
+
|
285
|
+
</div>
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<!-- テキストエリア お問い合わせ -->
|
298
|
+
|
299
|
+
<div class="form-group">
|
300
|
+
|
301
|
+
<label class="col-md-4 control-label" for="contact">お問い合わせ <span class="label label-info">任意</span></label>
|
302
|
+
|
303
|
+
<div class="col-md-4">
|
304
|
+
|
305
|
+
<textarea name="contact" placeholder="お問い合わせ" rows="3" class="form-control" id="contact"></textarea>
|
306
|
+
|
307
|
+
</div>
|
308
|
+
|
309
|
+
</div>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
<!-- Button 送信ボタン -->
|
318
|
+
|
319
|
+
<div class="form-group">
|
320
|
+
|
321
|
+
<label class="col-md-4 control-label" for="singlebutton"></label>
|
322
|
+
|
323
|
+
<div class="col-sm-offset-5 col-sm-7 col-xs-offset-4 col-xs-8">
|
324
|
+
|
325
|
+
<a href="http://192.168.33.15"><button type="button" name="singlebutton" class="btn btn-primary" id="singlebutton">戻る</button></a>
|
326
|
+
|
327
|
+
<button name="singlebutton" class="btn btn-primary" id="singlebutton">確認する</button>
|
328
|
+
|
329
|
+
</div>
|
330
|
+
|
331
|
+
</div>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
</fieldset>
|
340
|
+
|
341
|
+
</form>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
348
|
+
|
349
|
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
350
|
+
|
351
|
+
</body>
|
352
|
+
|
353
|
+
</html>
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
47
359
|
```
|
48
360
|
|
49
361
|
|
2
画像の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -257,3 +257,7 @@
|
|
257
257
|
リダイレクトした画像
|
258
258
|
|
259
259
|
![イメージ説明](c36cdb900ff82249276fb4ef4549468c.png)
|
260
|
+
|
261
|
+
問題ない場合の画像(本当は確認フォームへいくはずなのに、いきません)
|
262
|
+
|
263
|
+
![イメージ説明](c4ea9652b5170769b08f16e8578e91d3.png)
|
1
画像の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -249,3 +249,11 @@
|
|
249
249
|
|
250
250
|
|
251
251
|
```
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
リダイレクトした画像
|
258
|
+
|
259
|
+
![イメージ説明](c36cdb900ff82249276fb4ef4549468c.png)
|