-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhod.php
80 lines (70 loc) · 3.7 KB
/
hod.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php include('./Connect.php');
session_start(); ?>
<html>
<head>
<title>Main</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>
<body>
<h1>Test</h1>
<div class="card">
<div class="card-body">
<form method="POST">
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label">HOD Id :</label>
<input type="text" class="form-control" id="exampleFormControlInput1" name="h_id">
</div>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label">Department :</label>
<input type="text" class="form-control" id="exampleFormControlInput1" name="dept">
</div>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label">First Name :</label>
<input type="text" class="form-control" id="exampleFormControlInput1" name="F_name">
</div>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label">Middle Name :</label>
<input type="text" class="form-control" id="exampleFormControlInput1" name="M_name">
</div>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label">Last Name :</label>
<input type="text" class="form-control" id="exampleFormControlInput1" name="L_name">
</div>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label">Email address :</label>
<input type="text" class="form-control" id="exampleFormControlInput1" name="email">
</div>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label">Contact No :</label>
<input type="text" class="form-control" id="exampleFormControlInput1" name="contact">
</div>
<button type="submit" class="btn btn-primary" name="hod">Submit</button>
</form>
<!----------------------- PHP Backend ---------------------->
<?php
if (isset($_POST['hod'])) {
$h_id = $_POST['h_id'];
$dept = $_POST['dept'];
$F_name = $_POST['F_name'];
$M_name = $_POST['M_name'];
$L_name = $_POST['L_name'];
$email = $_POST['email'];
$password = 'dypatil@456';
$contact = $_POST['contact'];
$query = "INSERT INTO `hod` VALUES ('$h_id','$dept','$F_name','$M_name','$L_name','$email','$password','$contact')";
$res = mysqli_query($Connect, $query);
if (!$res) {
echo ("<script>alert('Error!! data not inserted into database')</script>");
} else {
echo ("<script>alert('You have Sucessfully Registred!')</script>");
echo ("<script>window.location = 'hod.php'</script>");
}
}
?>
</div>
</div>
</body>
</html>