-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup_controller.php
42 lines (34 loc) · 1.55 KB
/
signup_controller.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
<?php
$conn;
include 'connection.php';
$name = $_POST["signUp_name"];
$email = $_POST["signUp_email"];
$password = $_POST["signUp_password"];
$conf_password = $_POST["signUp_passwordConfirm"];
$phone_no= $_POST["signUp_phoneNo"];
$guest = "Guest";
$deg = "none";
$status = "active";
$authority = "ROLE_GUEST";
if($password == $conf_password){
$query = "INSERT INTO guest(name,email,phone_no,password)
VALUES('$name','$email','$phone_no','$password')";
if($conn->query($query) == false){
die("Guest info invalid!! Try Again !!");
header("Location: login.html");
}
else {
$query_user = "INSERT INTO officer(first_name, last_name, section_name, phone_no, password, email, designation, status, authority)
VALUES ('$guest','$name',' ',$phone_no,'$password','$email','$deg','$status','$authority')";
if($conn->query($query_user) == false){
die("user info invalid!!");
}
else{
header("Location: login.html");
}
}
} else{
die("password did not match try again!!");
header("Location: login.html");
}
?>