質問編集履歴
1
編集完了ページ
test
CHANGED
File without changes
|
test
CHANGED
@@ -137,3 +137,87 @@
|
|
137
137
|
<input type="submit" name="submit" class="submit" value="変更する" onclick="return confirm('会員情報を変更してよろしいですか?')">
|
138
138
|
|
139
139
|
```
|
140
|
+
|
141
|
+
■edit_pf_complete.php
|
142
|
+
|
143
|
+
```
|
144
|
+
|
145
|
+
<?php
|
146
|
+
|
147
|
+
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
|
148
|
+
|
149
|
+
if (!parse_url($referer, PHP_URL_HOST) == 'edit_pf_form.php'){
|
150
|
+
|
151
|
+
header('Location: top.php');
|
152
|
+
|
153
|
+
return;
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
session_start();
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
require_once('../Models/User.php');
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
$err = [];
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
if(!$name = filter_input(INPUT_POST,'user_name')){
|
174
|
+
|
175
|
+
$err['user_name'] = 'ユーザー名を入力してください';
|
176
|
+
|
177
|
+
}else if(mb_strlen($name) > 10){
|
178
|
+
|
179
|
+
$err['user_name'] = '*10文字以内で入力してください';
|
180
|
+
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
$pattern_add = "/^([a-zA-Z0-9])+([a-zA-Z0-9._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9._-]+)+$/";
|
186
|
+
|
187
|
+
if(!$email = filter_input(INPUT_POST,'mail')){
|
188
|
+
|
189
|
+
$err['mail'] = '*メールアドレスを入力してください';
|
190
|
+
|
191
|
+
}else if(!preg_match($pattern_add, $email)){
|
192
|
+
|
193
|
+
$err['mail'] = '*メールアドレスは正しい形式で入力してください';
|
194
|
+
|
195
|
+
}
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
if(count($err) > 0){
|
202
|
+
|
203
|
+
$_SESSION['err'] = $err;
|
204
|
+
|
205
|
+
header('Location: edit_pf_form.php');
|
206
|
+
|
207
|
+
return;
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
}else {
|
212
|
+
|
213
|
+
$user = new UserLogic();
|
214
|
+
|
215
|
+
$user->updateUser($_POST,$_FILES);
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
?>
|
222
|
+
|
223
|
+
```
|