-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent_signup_backend.php
More file actions
160 lines (132 loc) · 3.69 KB
/
student_signup_backend.php
File metadata and controls
160 lines (132 loc) · 3.69 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
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
<?php
include('conn.php');
session_start();
$username=$_POST['username'];
$name=$_POST['name'];
$contact=$_POST['number'];
$email=$_POST['mail'];
$pasword=$_POST['password'];
$conf_pass=$_POST['confirm_password'];
$sql1="SELECT * FROM `students` WHERE `Username`='$username'";
$res1=mysqli_query($conn,$sql1);
$rows=mysqli_num_rows($res1);
if($rows>0){
echo "Username already exists";
header('Location: signup_student.html');
}
else{
if($pasword==$conf_pass){
$sql="INSERT INTO `students` (`Name`, `Contact`, `Email`, `Username`, `Password`) VALUES ('$name', '$contact', '$email', '$username', '$pasword'); ";
$res=mysqli_query($conn,$sql);
if($res){
echo "row inserted successfully";
}
else{
echo "error";
}
}
else{
echo '
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tuition Fee Waiver</title>
<link rel="stylesheet" href="login_student_style.css">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4; /* Light background for contrast */
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
}
header {
background-color: #e74c3c; /* Header color */
width: 100%;
padding: 20px 0;
color: white;
text-align: center;
}
nav {
margin: 20px 0;
}
.nav-links {
list-style-type: none;
padding: 0;
}
.nav-links li {
display: inline;
margin: 0 15px;
}
.nav-links a {
text-decoration: none;
color: #e74c3c; /* Link color matching the header */
font-weight: bold;
}
.nav-links a:hover {
text-decoration: underline; /* Underline effect on hover */
}
main {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.error-message {
background-color: #e74c3c; /* Error message color */
color: white; /* Improved text contrast */
padding: 20px;
border-radius: 5px;
text-align: center;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Shadow for depth */
margin: 20px;
max-width: 400px; /* Max width for better layout */
}
.error-message h2 {
margin: 0 0 10px; /* Spacing below the heading */
}
.error-message p {
margin: 0 0 15px; /* Spacing below the paragraph */
}
.error-message a {
color: white; /* Link color matching the text */
text-decoration: underline; /* Underline effect for the link */
}
.error-message a:hover {
text-decoration: none; /* Remove underline on hover */
}
</style>
</head>
<body>
<header>
<div class="header-container">
<h1>TEACHWAVE -</h1>
<h2>TUITION POINT</h2>
</div>
</header>
<nav>
<ul class="nav-links">
<li><a href="#">Home</a></li>
<li><a href="aboutus.html">About Us</a></li>
<li><a href="#">Login</a></li>
<li><a href="loginpage_admin.html">Login as admin</a></li>
</ul>
</nav>
<main>
<div class="error-message">
<h2>PASSWORD MISMATCH</h2>
<p>Please ensure that your passwords match and try again.</p>
<a href="signup_student.html">Return to Login</a>
</div>
</main>
</body>
</html>
';
}
}
?>