-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
82 lines (70 loc) · 3.43 KB
/
login.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
<?php
require 'function.php';
//cek login terdaftar tidak
if(isset($_POST['login'])){
$email = $_POST['email'];
$password = $_POST['password'];
//cocokin dengan database
$cekdatabase = mysqli_query($conn, "SELECT * FROM login where email='$email' and password='$password'");
//hitung jumlah data
$hitung = mysqli_num_rows($cekdatabase);
if($hitung>0){
$_SESSION['log'] = 'True';
header('location:index.php');
} else {
header('location:login.php');
};
};
if(!isset($_SESSION['log'])){
} else {
header('location:index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>SOB-SITE</title>
<link href="css/styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js" crossorigin="anonymous"></script>
</head>
<body class="bg-primary">
<div id="layoutAuthentication">
<div id="layoutAuthentication_content">
<main>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-5">
<div class="card shadow-lg border-0 rounded-lg mt-5">
<div class="card-header"><h3 class="text-center font-weight-light my-4">Login</h3></div>
<div class="card-body">
<form method="post">
<div class="form-group">
<label class="small mb-1" for="inputEmailAddress">Email</label>
<input class="form-control py-4" name="email" id="inputEmailAddress" type="email" placeholder="Enter email address" />
</div>
<div class="form-group">
<label class="small mb-1" for="inputPassword">Password</label>
<input class="form-control py-4" name="password" id="inputPassword" type="password" placeholder="Enter password" />
</div>
<div class="form-group d-flex align-items-center justify-content-between mt-4 mb-0">
<button class="btn btn-primary" name="login">Login</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="js/scripts.js"></script>
</body>
</html>