-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
220 lines (174 loc) · 5.36 KB
/
index.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
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Login</title>
<link href="https://fonts.googleapis.com/css2?family=Lexend+Peta&display=swap" rel="stylesheet">
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Lexend Peta', sans-serif;
}
body{
background-image: url(https://cdn5.vectorstock.com/i/1000x1000/78/04/open-book-background-flat-design-vector-5877804.jpg);
padding: 0;
margin: 0;
background-position: center;
background-size: cover;
font-family: 'Lexend Peta', sans-serif;
}
.hea{
margin-top: 10px;
width: 400px;
color: black;
font-family: 'Lobster', cursive;
height: 50px;
background-color: white;
border-radius: 10px;
margin-bottom: 0 px;
justify-content: center;
display: flex;
margin-left: 450px;
}
.star{
padding: 0;
margin: 0;
width: 100%;
height: 100px;
}
#logo{
padding: 10px;
height: 60px;
color: bisque;
font-weight: bold;
background-image: linear-gradient(white,black);
font-size: 30px;
display: flex;
justify-content: center;
border-radius: 15px;
}
.topcontainer{
margin: 20px 10px 101px 500px ;
justify-content: center;
height: 50px;
width: 50px;
}
#frst, #second, #thrd, #forth, #fifth, #sixth{
justify-content: center;
width: 265px;
padding: 10px 0px 0px 18px;
height: 50px;
background-color:rgb(235, 168, 168);
height: auto;
}
.abc{
margin-top: 250px;
margin-left: 450px;
margin-right: 450px;
display: flex;
padding: 10px 50px 10px 0px;
justify-content: space-evenly;
}
.abc a{
padding: 8px 10px 10px 10px;
}
#abcd{
height: 40px;
border-radius: 10px;
background-color: lightblue;
padding: 0px 10px 0px 10px ;
}
a:hover{
color: black;
transform: scale(1.2);
}
</style>
</head>
<body>
<?php
include 'connect.php';
if(isset($_POST['submit']))
{
$frstname = mysqli_real_escape_string($conn, $_POST['myname']);
$lastname = mysqli_real_escape_string($conn, $_POST['mname']);
$email = mysqli_real_escape_string ($conn, $_POST['myemail']);
$mobileno = mysqli_real_escape_string($conn, $_POST['myno']);
$pas = mysqli_real_escape_string($conn, $_POST['psw']);
$confrmpassword = mysqli_real_escape_string($conn, $_POST['pass']);
$passs = md5($pas);
$cpasss = md5($confrmpassword);
$emailquery = " select * from studentdata where email='$email' ";
$query = mysqli_query($conn,$emailquery);
$emailcount=mysqli_num_rows($query);
if($emailcount>0)
{
echo "email already registered";
}
else
{
if($pas === $confrmpassword){
$sql = "insert into studentdata(firstname,lastname,email,mobilenumber,passw,cnfrmpassword) values('$frstname','$lastname','$email','$mobileno','$passs','$cpasss')";
$execute= mysqli_query($conn,$sql);
if($execute)
{
echo "inserted successfully";
header("location: login.php");
}
else
{
echo "not inserted";
}
}
else
{
echo " password not matching";
}
}
}
?>
<div class="star">
<nav>
<label id="logo">Apni kaksha</label>
</nav>
</div>
<form id="form" action="" method="POST">
<h1 class="hea">Create account</h1>
<div class="topcontainer">
<div id="frst">
<input type="text" placeholder="First name" name="myname" required>
</div>
<br>
<div id="second">
<input type="text" placeholder="last name" name="mname" required>
</div>
<br>
<div id="thrd">
<input type="email" placeholder="Email" name="myemail" required>
</div>
<br>
<div id="forth">
<input type="number" placeholder="mobile number" name="myno" required>
</div>
<br>
<div id="fifth">
<input type="password" placeholder="Enter Password..." name="psw" required>
</div>
<br>
<div id="sixth">
<input type="password" placeholder="Enter Password..." name="pass" required>
</div>
<br>
</div>
<div class="abc">
<button id="abcd" type="submit" name="submit">Create Account</button>
<a href="login.php"> Login now </a>
</div>
</form>
</body>
</html>