teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

投稿するソースコードを間違えましたのでソースコードを変更しました。

2021/01/31 07:13

投稿

noizi.
noizi.

スコア27

title CHANGED
File without changes
body CHANGED
@@ -12,95 +12,59 @@
12
12
  ### 該当のソースコード
13
13
 
14
14
  ```ここに言語名を入力
15
+ <?php
16
+ $C_name = $_GET['C_name'];
17
+ $C_num = $_GET['C_num'];
18
+ $C_phon = $_GET['C_phon'];
19
+ $C_sa = $_GET['C_sa'];
20
+ ?>
21
+
15
22
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
16
23
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17
24
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
18
25
  <head>
19
- <meta charset="utf8">
26
+ <meta charset="UTF-8">
20
- <meta name="viewport" content="width=device-width">
27
+ <meta name="viewport" content="width=device-width">
21
- <title>顧客登録</title>
28
+ <title>顧客登録</title>
22
- <link rel="stylesheet" href="ser_style.css">
29
+ <link rel="stylesheet" href="ser_style.css">
23
-
24
30
  </head>
25
31
  <body>
26
32
  <div class="content">
27
-
28
-
29
- <script type="text/javascript">
30
- function formCheck(){
31
- var flag = 0;
32
-
33
-
34
- if( document . form1 . C_num . value == "" ){
35
- flag = 1;
36
- document . getElementById( 'C_num' ) . style . display = "block";
37
- }else{
38
- document . getElementById( 'C_num' ) . style . display = "none";
39
- }
40
- if( document . form1 . C_name . value == "" ){
41
- flag = 1;
42
- document . getElementById( 'C_name' ) . style . display = "block";
43
- }else{
44
- document . getElementById( 'C_name' ) . style . display = "none";
45
- }
46
- if( document . form1 . C_phon . value == "" ){
47
- flag = 1;
48
- document . getElementById( 'C_phon' ) . style . display = "block";
49
- }else{
50
- document . getElementById( 'C_phon' ) . style . display = "none";
51
- }
52
- if( document . form1 . C_sa . value == "" ){
53
- flag = 1;
54
- document . getElementById( 'C_sa' ) . style . display = "block";
55
- }else{
56
- document . getElementById( 'C_sa' ) . style . display = "none";
57
- }
58
-
59
- if( flag ){
60
- window . alert( '項目は全て入力して下さい。' );
61
- return false;
62
- }else{
63
- return true;
64
- }
65
-
66
- }
67
- </script>
68
-
69
- </form>
70
- <h1>顧客登録</h1>
33
+ <h1>以下の情報を登録しますが、よろしいでしょうか?</h1>
71
- <form action="c_regi_veri.php" method="GET" name="form1" onSubmit="return formcheck()">
34
+ <form action="c_regi_ans.php" method="get">
72
35
  <div class="control">
73
- <label for="C_num">顧客番号(修正不可、半角数字のみ入力可)<span class="required">必須</span></label>
36
+ <label for="C_num">顧客番号</label>
74
- <p id="C_num" style="display: none; color: red;"> 【入力して下さい】</p>
75
- <input id="C_num" type="number" maxlength="6" name="C_num" value=""/>
37
+ <input readonly id="C_num" type="number" name="C_num" value="<?php print($C_num);?>">
76
38
  </div>
77
39
  <div class="control">
78
- <label for="C_name">顧客名(全角カナのみ入力可)<span class="required">必須</span></label>
40
+ <label for="C_name">顧客名</label>
79
- <p id="C_name" style="display: none; color: red;"> 【入力して下さい】</p>
80
- <input pattern="[^\x20-\x7E]*" id="C_name" type="text" name="C_name" value=""/>
41
+ <input readonly id="C_name" type="text" name="C_name" value="<?php print($C_name);?>">
81
42
  </div>
82
43
  <div class="control">
83
- <label for="C_phon">顧客電話番号(11桁まで入力可)<span class="required">必須</span></label>
44
+ <label for="C_phon">顧客電話番号</label>
84
- <p id="C_phon" style="display: none; color: red;"> 【入力して下さい】</p>
85
- <input pattern="^[0-9]+$" id="C_phon" type="tel" type="tel" maxlength="11" name="C_phon" value=""/>
45
+ <input readonly id="C_phon" type="tel" name="C_phon" value="<?php print($C_phon);?>">
86
46
  </div>
87
47
  <div class="control">
88
- <label for="C_sa">顧客住所<span class="required">必須</span></label>
48
+ <label for="C_sa">顧客住所</label>
89
- <p id="C_sa" style="display: none; color: red;"> 【入力して下さい】</p>
90
- <input id="C_sa" type="text" name="C_sa" value=""/>
49
+ <input readonly id="C_sa" type="text" name="C_sa" value='<?php print($C_sa);?>'>
91
50
  </div>
92
51
  <div class="control">
93
- <input type="submit" value="登録">
52
+ <input type="submit" value="確定">
94
53
  </div>
95
54
  </form>
96
- <form action="menu.php" method="GET">
55
+ <form action="c_regi.php" method="get">
56
+ <input type="hidden" name="C_name" value="<?php print($C_name); ?>">
57
+ <input type="hidden" name="C_num" value="<?php print($C_num); ?>">
58
+ <input type="hidden" name="C_phon" value="<?php print($C_phon); ?>">
59
+ <input type="hidden" name="C_sa" value="<?php print($C_sa); ?>">
97
60
  <div class="control">
98
- <input type="submit" value="メニューへ">
61
+ <input type="submit" value="戻る">
99
62
  </div>
100
63
  </form>
101
64
  </div>
102
65
  </body>
103
66
  </html>
67
+
104
68
  ```
105
69
 
106
70
  ### 試したこと