-
Notifications
You must be signed in to change notification settings - Fork 0
/
loginPage.php
84 lines (81 loc) · 2.86 KB
/
loginPage.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
<?php
session_start();
include 'inc/connection.php';
// CHECK SESSION START
// $_SESSION['email']=$_POST['email'];
// $_SESSION['pass']=$_POST['password'];
if (isset($_POST['submit'])) {
$email = $_POST['email'];
$pass = $_POST['password'];
$query = "SELECT * from adminpass where email = '$email' and password='$pass' ";
$result = mysqli_query($conn, $query);
$row = mysqli_num_rows($result);
if ($row > 0) {
$_SESSION['email'] = $_POST['email'];
header("Location: admin/admindashboard.php");
} else {
`<script> function myFunction()
{
var element = document.getElementById("eror");
element.classList.add("alert alert-danger mt-3");<script>`;
}
}
if (isset($_SESSION['email'])) {
header("Location: admin/admindashboard.php");
}
?>
<?php include 'blad/navbar.php'; ?>
<div class="container">
<div class="row">
<div class="col-md-4 firstDiv">
<img src="images/bodyBuilder2.png" width="100%" alt="">
</div>
<div class="col-md-2 "></div>
<!-- ---------login-mechnism-- -->
<div class="col-md-6 loginPage text-center">
<div class="loginP">
<img src="images/loginLogo.gif" width="45%">
<h1>Login</h1>
<form method="POST" action="loginPage.php" style="width:400px; margin: auto;">
<div class="form-group row">
<div class="col-lg-8" style="margin: auto; margin-top: 20px;">
<input type="text" class="form-control bg-light" id="emailid" name="email" placeholder="Enter Email">
</div>
</div>
<div class="form-group row">
<div class="col-lg-8" style="margin: auto; margin-top: 20px;">
<input type="password" class="form-control bg-light" id="emailid" name="password" placeholder="Enter Password">
</div>
</div>
<div class="form-group row">
<div class="offset-md-5 col-md-7" style="margin: auto; margin-top: 20px;">
<button type="submit" name="submit" class="btn btn-primary">Login</button>
</div>
<div id="eror" class="" role="alert"></div>
</form>
</div>
</div>
<div class="slider">
<div>photo1 </div>
<div>photo3</div>
<div>photo3</div>
</div>
<script>
$('.slider').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
asNavFor: '.slider-nav'
});
$('.slider-nav').slick({
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: '.slider-for',
dots: true,
centerMode: true,
focusOnSelect: true
});
</script>
</body>
</html>