-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserUpdateProfile.inc.php
39 lines (31 loc) · 1.06 KB
/
userUpdateProfile.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once('dbh.inc.php');
require_once('functions.inc.php');
$userId = $_POST["userId"];
// $userName = $_POST["userName"];
// $userEmail = $_POST["userEmail"];
// $userPhone = $_POST["userPhone"];
$pwd = $_POST["pwd"];
$repwd = $_POST["repwd"];
if (isset($_POST["submit"])) {
if (userUpdateEmptyInput($pwd, $repwd) !== false) {
header("Location: ../user/profile/updateUser.php?userId=" . $userId . "&error=emptyInput");
exit();
}
// if (invaliduName($userName) !== false) {
// header("location: ../profile/updateUser.php?error=invaliduName");
// exit();
// }
// if (invalidEmail($userEmail) !== false) {
// header("location: ../profile/updateUser.php?error=invalidEmail");
// exit();
// }
if (pwdMatch($pwd, $repwd) !== false) {
header("location: ../user/profile/updateUser.php?userId=" . $userId . "&error=pwdDontMatch");
exit();
}
userUpdateProfile($conn, $userId, $pwd);
} else {
header("location: ../user/profile/updateUser.php?userId=" . $userId);
exit();
}