-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminlogin.php
76 lines (72 loc) · 2.68 KB
/
adminlogin.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
<?php
include 'dbconnect.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Yinka Enoch Adedokun">
<title>Admin Login</title>
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<link rel="stylesheet" href="css/style_login.css">
</head>
<body style="background-image: linear-gradient(to right, #A2DDF6 , #008ECC);">
<!-- Main Content -->
<div class="container-fluid">
<div class="row main-content bg-success text-center">
<div class="col-md-4 text-center company__info">
<span class="company__logo"><h2><span class="fa fa-university"></span></h2></span>
<h4 class="company_title">Vivekanada Education Society's Institute Of Technology</h4>
</div>
<div class="col-md-8 col-xs-12 col-sm-12 login_form ">
<div class="container-fluid">
<div class="row">
<h2>Log In</h2>
</div>
<div class="row">
<form action="adminlogin.php" class="form-group" method="POST">
<div class="row">
<input type="text" name="username" id="username" class="form__input" placeholder="User Name" required>
</div>
<div class="row">
<input type="password" name="password" id="password" class="form__input" placeholder="Password" required>
</div>
<div class="row">
<input name="adminloginbtn" type="submit" value="Login" class="btn">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
<?php
if(isset($_POST['adminloginbtn'])){
// echo "Successful";
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "SELECT * FROM admin WHERE User='$username' and Password='$password';";
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
if(mysqli_num_rows($result)==1){
$_SESSION['name']=$row['User'];
echo '<script> window.location.href="addsubject.php";</script>';
}
else{
echo '<script> swal({
title: "Login Failed!",
text: "Please Enter Valid Credentials..",
icon: "error",
});</script>';
}
}
// else{
// echo "not successful";
// }
?>