forked from srivatsav1998/Attendance-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·30 lines (29 loc) · 745 Bytes
/
Copy pathindex.php
File metadata and controls
executable file
·30 lines (29 loc) · 745 Bytes
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
<?php
require 'php/connection.php';
$conn = Connect();
if((!isset($_COOKIE['login']))&&($_COOKIE['login']=="")){
header("location: login.html");
}
else{
$username = $_COOKIE['login'];
$myquery = mysqli_query($conn, "SELECT * FROM permanent_list WHERE user_name = '$username'");
$myquery = mysqli_fetch_assoc($myquery);
$password = $myquery["password"];
if(($_COOKIE['login']!="" )&& ($_COOKIE['password']!="")){
if($password == $_COOKIE['password']){
if($username == "admin"){
header("location: admin/admin.html");
}
else{
header("location: student/student.html");
}
}
else{
echo "Nice try kiddo";
}
}
else{
echo "Nice Try kiddo!";
}
}
?>