-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateUser.php
34 lines (26 loc) · 1.23 KB
/
createUser.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
<?php
$conn;
include 'connection.php';
$firstName = $_POST["firstName"];
$lastName = $_POST["lastName"];
$email = $_POST["email"];
$password = $_POST["password"];
$conf_password = $_POST["conf_password"];
$phone_no= $_POST["phone_no"];
$section = $_POST["secId"];
$designation = $_POST["designation"];
$status = "active";
$authority = $_POST["role"];
if($password == $conf_password){
$query = "INSERT INTO officer(first_name, last_name, section_name, phone_no, password, email, designation, status, authority)
VALUES ('$firstName','$lastName','$section',$phone_no,'$password','$email','$designation','$status','$authority')";
if($conn->query($query) == false){
die("user info invalid!! Try Again !!");
}else{
header("Location: main.php");
}
} else{
die("password did not match try again!!");
header("Location: addOfficer.php");
}
?>