-
Notifications
You must be signed in to change notification settings - Fork 0
/
Faculty_Registration.php
178 lines (133 loc) · 4.1 KB
/
Faculty_Registration.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
//connect to my sql
$conn = mysqli_connect('localhost','root','123456','universitymanagment');
?>
<html>
<head>
</head>
<body>
<style>
div{
background: linear-gradient(to bottom right, #3333cc 6%, #ffffff 100%);
height: auto;
}
/* Full-width input fields */
input[type=text], input[type=password],input[type=Number],input[type=date] {
width: 30%;
padding: 12px 20px;
margin: 8px 0;
height:10px;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
/* Set a style for all buttons */
button {
background-color: green;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 25%;
}
/* Extra styles for the cancel button */
.cancelbtn {
padding: 14px 20px;
background-color: #f44336;
width=25%;
}
/* Float cancel and signup buttons and add an equal width */
/* Add padding to container elements
.container1 {
width:100%;
padding: 16px;
background: url(C:\Users\hp\Desktop\images.jpg);
background-size: contain;
background-repeat: no-repeat;
}*/
/* Clear floats */
.clearfix::after {
content: "";
clear: both;
display: table;
height:30px;
}
/* Change styles for cancel button and signup button on extra small screens */
label{
min-width:180px;
display: inline-block;
}
</style>
<title>
Register</title>
<br><br>
<h1><b>Registration for faculty login</b></h1>
<form method="POST" action="Faculty_Registration.php" style="border:1px solid #ccc">
<div>
<class="container1">
<fieldset>
<legend>Personal details</legend>
<label><b>Name of faculty</b> </label>
<input type="text" placeholder="Enter faculty name" name="sname" required ><br>
<label><b>Designation</b> </label>
<input type="text" placeholder="Designation of faculty" name="dname" required ><br>
<label><b>Select Gender</b></label>
<select name="gender">
<option default>Select Gender</option>
<option value="M">Male</option>
<option value="F">Female</option>
</select><br>
<label><b>Salary</b> </label>
<input type="number" placeholder="Salary" name="dnum" required ><br>
</fieldset>
<br>
<class="container2">
<fieldset>
<legend>Account details</legend>
<label><b>Faculty ID</b></label>
<input type="Number" placeholder="Enter faculty id" name="faculty_id" required><br>
<label><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password" required><br>
<label><b>Select Department</b></label>
<select name="Department">
<option default>Department Number</option>
<option value="100">Computer Science</option>
<option value="200">Electrical and electronics</option>
<option value="300">Mechanical</option>
</select><br>
<br>
</fieldset>
</div>
<br>
<div1 class="clearfix">
<button type="button" class="cancelbtn" >Cancel</button>
<button type="submit" name="submit" class="signupbtn" value="Submit">Register</button>
</div1>
</form>
<br>
<?php
if(isset($_POST['submit']))
{
$cou1=$_POST['sname'];
$cou2=$_POST['dname'];
$cou3=$_POST['gender'];
$cou4=$_POST['dnum'];
$cou5=$_POST['faculty_id'];
$cou6=$_POST['password'];
$cou7=$_POST['Department'];
$query = "INSERT INTO faculty VALUES($cou4,$cou7,$cou5,'$cou1','$cou3','$cou2',$cou6)";
$run=mysqli_query($conn,$query);
if($run)
{
header ("location:http://localhost/UNIVERSITY_MANAGEMENT_SYSTEM/Faculty_Info.php");
//echo "Thank you for registration";
}
else
{
echo "Not registered";
}
}
?>
</body>
</html>