-
Notifications
You must be signed in to change notification settings - Fork 0
/
teacher-registration.php
87 lines (82 loc) · 2.6 KB
/
teacher-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
<?php
session_start();
if(!isset($_SESSION['login']))
{
header("location:session-expired.php");
}
else
if($_SESSION['login']!="admin")
{
header("location:session-expired.php");
}
else{
?>
<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>Register</title>
<link rel="stylesheet" href="home-style.css">
<link rel="stylesheet" href="student-reg.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500&family=Raleway:wght@400;500&display=swap" rel="stylesheet">
<style>
body{
overflow-y:hidden;
}
.form-container{
padding-top:100px;
}
.reg-form{
height:50%;
}
.reg-form input[type=text], .reg-form input[type=email]{
height:10%;
}
</style>
</head>
<body>
<!-----------------------------navbar--------------------------->
<nav class="nav-bar">
<span class="logo" >LGM</span>
<div class="links">
<a href="index.php" class="link-text">Home</a>
<a href="logout.php" class="link-text">log Out</a>
<a href="index.php#form" class="link-text">Contact</a>
</div>
</nav>
<!-- student registration section -->
<div id="registration">
</video>
<div class="form-container">
<br>
<form action="" method="post" class="reg-form" >
<!-- onsubmit="sendEmail(); reset(); return false;" -->
<h1>Teacher Registration</h1>
<span class="text-box-text">Teacher Name</span> <input type="text" name="tname" required>
<span class="text-box-text"> Teacher Email</span> <input type="email" name="temail" required>
<span class="text-box-text"> Teacher Password</span> <input type="text" name="tpassword" required >
<p class="reg-button-container" ><input type="submit" value="Register" class="reg-button" name="reg" required> </p>
</form>
</div>
<?php
if(isset($_REQUEST['reg']))
{
$con=mysqli_connect("localhost","root","","result_db");
if(!$con)
{
echo "could not connect";
}
$tname=$_REQUEST['tname'];
$temail=$_REQUEST['temail'];
$tpassword=$_REQUEST['tpassword'];
mysqli_query($con,"insert into teacher_login(tname,temail,tpassword)values('".$tname."','".$temail."','".$tpassword."')");
header("location:teachers.php");
}
}
?>
</div>
</body>
</html>