-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathregistration.php
249 lines (172 loc) · 10 KB
/
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<?php
include "connection.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Student Registration Portal</title>
<!-- Latest compiled and minified CSS -->
<link href="https://fonts.googleapis.com/css?family=Lobster&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>
<body >
<div class="container">
<form class="well form-horizontal" name="form1" action=" " method="post" >
<fieldset>
<!-- Form Name -->
<center> <h1 style="font-family: 'Lobster', cursive;"><b>Student Registration Form</b></h1></center>
<br>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label">First Name</label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input name="fname" placeholder="First Name" class="form-control" type="text" required="">
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" >Last Name</label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input name="sname" placeholder="Last Name" class="form-control" type="text" required="">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Department</label>
<div class="col-md-4 selectContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-list"></i></span>
<select name="dept" class="form-control selectpicker" >
<option value="">Select your Department</option>
<option>CSE</option>
<option>ECE</option>
<option >EE</option>
<option >ME</option>
<option >CE</option>
</select>
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label">Username</label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input name="username" placeholder="Username" class="form-control" type="text">
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" >Password</label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input name="password" placeholder="Password" class="form-control" type="password">
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label">E-Mail</label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
<input name="email" placeholder="E-Mail Address" class="form-control" type="text">
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label">Contact No.</label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-earphone"></i></span>
<input name="contact" placeholder="(+91)" class="form-control" type="text">
</div>
</div>
</div>
<!-- Text input -->
<div class="form-group">
<label class="col-md-4 control-label">SEM</label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-education"></i></span>
<input type="text" class="form-control" placeholder="SEM" name="sem" required=""/>
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label">Roll No</label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-info-sign"></i></span>
<input type="text" class="form-control" placeholder="Roll No" name="rollno" required=""/>
</div>
</div>
</div>
<div>
<input type="hidden" name="form_submitted" value="1" />
<!--it is a hidden value which is used to check whether the form has been submitted or not-->
</div>
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-4"><br>
              <button type="submit" class="btn btn-warning" name="bsubmit" >        SUBMIT <span class="glyphicon glyphicon-send"></span>        </button>
</div>
</div>
<?php
if(isset($_POST['bsubmit'])){
global $a,$b,$c,$d,$e,$f,$g,$h,$k;
if ($_SERVER['REQUEST_METHOD']=='POST'){
if(isset($_POST['fname']))
$a=$_POST["fname"];
if(isset($_POST['sname']))
$b=$_POST["sname"];
if(isset($_POST['dept']))
$k=$_POST["dept"];
if(isset($_POST['username']))
$c=$_POST["username"];
if(isset($_POST['password']))
$d=$_POST["password"];
if(isset($_POST['email']))
$e=$_POST["email"];
if(isset($_POST['contact']))
$f=$_POST["contact"];
if(isset($_POST['sem']))
$g=$_POST["sem"];
if(isset($_POST['rollno']))
$h=$_POST["rollno"];
}
//by default student account status will be no that means blocked ..
//only when admin approves , status will be yes and student will be able to login
$sql= mysqli_query($conn,"insert into student(fname,sname,dept,username,password,email,contact,sem,rollno,status)".
"values ('$a','$b','$k','$c','$d','$e','$f','$g','$h','no')");
?>
<!-- Success message -->
<center> <div class="alert alert-success" role="alert" id="success_message">Registration Successful <i class="glyphicon glyphicon-thumbs-up"></i> You will be notified once your account is approved</div></center>
</fieldset>
</form>
</div>
<?php
}
?>
</body>
</html>