-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminRegister.inc.php
47 lines (38 loc) · 1.2 KB
/
adminRegister.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
40
41
42
43
44
45
46
47
<?php
require_once('dbh.inc.php');
require_once('functions.inc.php');
$name = $_POST["name"];
$email = $_POST["email"];
$pwd = $_POST["pwd"];
$repwd = $_POST["repwd"];
if (isset($_POST["submit"])) {
if (adminRegisterEmptyInput($name, $email, $pwd, $repwd) !== false) {
header("location: ../admin/main/register.php?error=emptyInput");
exit();
}
if (invaliduName($name) !== false) {
header("location: ../admin/main/register.php?error=invaliduName");
exit();
}
if (invalidEmail($email) !== false) {
header("location: ../admin/main/register.php?error=invalidEmail");
exit();
}
if (invalidPwd($pwd) == false) {
header("location: ../admin/main/register.php?error=invalidPwd");
exit();
}
if (pwdMatch($pwd, $repwd) !== false) {
header("location: ../admin/main/register.php?error=pwdDontMatch");
exit();
}
if (adminuNameEmailExists($conn, $name, $email) !== false) {
header("location: ../admin/main/register.php?error=uNameTaken");
exit();
} else {
adminRegister($conn, $name, $email, $pwd);
}
} else {
header("location: ../admin/main/register.php");
exit();
}