-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteacher_registration.php
More file actions
104 lines (84 loc) · 3.48 KB
/
Copy pathteacher_registration.php
File metadata and controls
104 lines (84 loc) · 3.48 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Teacher Registration</title>
<!-- font awesome cdn link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css">
<!-- custom css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<section class="form-container">
<form method = "post" action ="teacher_registration.php" enctype="multipart/form-data">
<h3>Register New Teacher</h3>
<p>First name <span>*</span></p>
<input type="text" name="fname" placeholder="enter your first name" required maxlength="50" class="box">
<p>Last name <span>*</span></p>
<input type="text" name="lname" placeholder="enter your last name" required maxlength="50" class="box">
<p>User name <span>*</span></p>
<input type="text" name="uname" placeholder="enter your user name" required maxlength="50" class="box">
<p>Date of birth <span>*</span></p>
<input type="date" name="dob" placeholder="enter your date of birth" required maxlength="50" class="box">
<p>Gender <span>*</span></p>
<P><input type="radio" name="gender" value="Male" required> Male
<input type="radio" name="gender" value="Female" required> Female</p>
<p>E-mail <span>*</span></p>
<input type="email" name="email" placeholder="enter your email" required maxlength="50" class="box">
<p>Phone <span>*</span></p>
<input type="text" name="phone" placeholder="enter your phone number" required maxlength="50" class="box">
<p>Address <span>*</span></p>
<input type="text" name="address" placeholder="enter your address" required maxlength="50" class="box">
<p>Password <span>*</span></p>
<input type="password" name="password" placeholder="enter your password" required maxlength="20" class="box">
<p>Confirm password <span>*</span></p>
<input type="password" name="pass1" placeholder="confirm your password" required maxlength="20" class="box">
<p>select profile <span>*</span></p>
<input type="file" accept="image/*" required class="box">
<input type="submit" value="register new" name="submit" class="btn">
<input type="submit" value="Cancel" name="Back" class="btn">
</form>
</section>
<!-- custom js file link -->
<script src="js/script.js"></script>
</body>
</html>
<?php
@include 'dbcon.php';
if(isset($_POST['submit']))
{
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$uname = $_POST['uname'];
$dob = $_POST['dob'];
$gender = $_POST['gender'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$address = $_POST['address'];
$password = $_POST['password'];
$pass1 = $_POST['pass1'];
if($password == $pass1)
{
$sql = "INSERT INTO `teacher_registration`(`fname`, `lname`, `uname`, `DOB`, `gender`, `email`, `phone`, `address`, `password`)
VALUES
('$fname',' $lname','$uname','$dob ','$gender','$email','$phone','$address','$password')";
$result=mysqli_query($conn,$sql);
if($result)
{
echo "<i>Registration Completed Successfully!</i>";
}
}
else
{
echo "<i>Password doesn't match</i>";
}
}
?>
<?php
if(isset($_POST['Back']))
{
header('location:admin_homepage.php');
}
?>