-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathteacherreg.php
94 lines (86 loc) · 2.99 KB
/
teacherreg.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
<?php session_start();
include 'dbconnect.php';
if(!isset($_SESSION['user']))
{
header("Location: index.php");
}
if((isset($_POST['btn-login'])))
{
$name = $_POST['name'];
$login_id = $_POST['email_id'];
$password = $_POST['pass'];
$branch = $_POST['branch'];
$mobno = $_POST['mobno'];
$gender = $_POST['gender'];
if($gender=="male")
{$images_path="images/teacher_dp/male.jpg";
}
else{
$images_path="images/teacher_dp/female.jpg";
}
$result = mysqli_num_rows(mysqli_query($bd,"SELECT * FROM teacher WHERE login_id = '$login_id'"));
if($result == 1)
{?>
<script>alert("The username you have chosen already exists!");</script>
<?php
}
else
{
$ab=mysqli_query($bd,"INSERT INTO teacher(id,login_id,full_name,password,gender, branch, mobile_no, authority, event_auth,images_path,submission_date) VALUES (NULL,'$login_id','$name','$password','$gender','$branch',$mobno,'','','$images_path','')");
if(!$ab){echo mysqli_error($bd);}
?>
<script>alert("Successfully Registered");
window.location.href='teachermyprofile.php';</script>
<?php
}
}
?>
<?php
include 'header.php';
include 'validation.php';
include 'teachersidenavbar.php'; ?>
<div class="col-sm-9">
<div class="main" id="myprofile">
<center>
<h1>Register As Teacher</h1>
<div class="login-form" >
<form method="post">
<table class="loggedin" align="center" width="40%" border="0">
<tr>
<td><input type="text" name="name" placeholder="Full Name" required /></td>
</tr>
<tr>
<td><input type="text" name="email_id" placeholder="Your College Email ID" required/></td>
</tr>
<tr>
<td><input type="password" name="pass" placeholder="Your Password" required/></td>
</tr>
<tr>
<td> <input type="radio" name="gender" value="male"><center> Male</center>
<input type="radio" name="gender" value="female" checked><center> Female</center></td>
</tr>
<tr>
<td><select class="logincat" name="branch" required>
<option value="branch" disabled="disabled" selected="selected" >Branch</option>
<option value="co">CO</option>
<option value="cm">CM</option>
<option value="ie">IE</option>
<option value="ev">EV</option>
<option value="et">ET</option>
</select>
</td>
</tr>
<tr>
<td><input type="text" name="mobno" placeholder="Your Mobile No"></td>
</tr>
<tr>
<td><button type="submit" name="btn-login">Register</button></td>
</tr>
</table>
</form>
</div>
</center>
</div>
</div>
</div>
<?php include 'footer.php'; ?>