質問編集履歴

1

staff_add_check.phpを追加しました

2020/01/19 11:39

投稿

aka88533383
aka88533383

スコア10

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
-
5
+ staff_add.php↓
6
6
 
7
7
  ```html
8
8
 
@@ -50,6 +50,106 @@
50
50
 
51
51
  ```
52
52
 
53
+ staff_add_check.php↓
54
+
55
+ ```html
56
+
57
+ <!DOCTYPE html>
58
+
59
+ <html>
60
+
61
+ <head>
62
+
63
+ <meta charset="UTF=8">
64
+
65
+ <title>タイトル</title>
66
+
67
+ </head>
68
+
69
+ <body>
70
+
71
+ <?php
72
+
73
+ $staff_name=$_POST['name'];
74
+
75
+ $staff_pass=$_POST['pass'];
76
+
77
+ $staff_pass2=$_POST['pass2'];
78
+
79
+
80
+
81
+ $staff_name= htmlspecialchars($staff_name,ENT_QUOTES,'UTF-8');
82
+
83
+ $staff_pass= htmlspecialchars($staff_pass,ENT_QUOTES,'UTF-8');
84
+
85
+ $staff_pass2= htmlspecialchars($staff_pass2,ENT_QUOTES,'UTF-8');
86
+
87
+
88
+
89
+ if($staff_name==''){
90
+
91
+ print'スタッフ名が入力されていません。</br>';
92
+
93
+ } else {
94
+
95
+ print 'スタッフ名:';
96
+
97
+ print $staff_name;
98
+
99
+ print '<br/>';
100
+
101
+ }
102
+
103
+
104
+
105
+ if($staff_pass==''){
106
+
107
+ print'パスワードが入力されていません。<br />';
108
+
109
+ }
110
+
111
+
112
+
113
+ if($staff_pass!==$staff_pass2){
114
+
115
+ print'パスワードが一致しません。<br />';
116
+
117
+ }
118
+
119
+
120
+
121
+ if($staff_name==''||$staff_pass==''||$staff_pass!==$staff_pass2){
122
+
123
+ print'<from>';
124
+
125
+ print'<input type="button" onclick="history.back()" value="戻る">';
126
+
127
+ } else {
128
+
129
+ $staff_pass=md5($staff_pass);
130
+
131
+ print'<from method="post" axtion="staff_add_done.php">';
132
+
133
+ print'<input type="hidden" name="name" value="'.staff_name.'">';
134
+
135
+ print'<input type="hidden" name="pass" value="'.staff_pass.'">';
136
+
137
+ print<br />;
138
+
139
+ print'<input type="button" onclic="history.back()" value="戻る">';
140
+
141
+ print'<input type="submit" value="OK">';
142
+
143
+ print'</from>';
144
+
145
+ ?>
146
+
147
+ </body>
148
+
149
+ </html>
150
+
151
+ ```
152
+
53
153
  okボタンを押すと次のエラーが出ます。
54
154
 
55
155