-
Notifications
You must be signed in to change notification settings - Fork 0
/
masuk.php
96 lines (88 loc) · 2.71 KB
/
masuk.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
<?php
include 'config.php';
error_reporting(0);
session_start();
if (isset($_SESSION['username'])) {
header("Location: ./aa/main.php");
}
if (isset($_POST['submit'])) {
$email = $_POST['email'];
$password = md5($_POST['password']);
$sql = "SELECT * FROM users WHERE email='$email' AND password='$password'";
$result = mysqli_query($conn, $sql);
if ($result->num_rows > 0) {
$row = mysqli_fetch_assoc($result);
$_SESSION['username'] = $row['username'];
header("Location: ./aa/main.php");
} else {
echo "<script>alert('Email atau password Anda salah. Silahkan coba lagi!')</script>";
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>DisBar</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<style>
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
.border1{
width: 250px;
height: 150px;
}
.btn1{
border: none;
outline: none;
height: 50px;
width: 50%;
background-color: black;
color: white;
border-radius: 5px;
font-weight: bold;
}
.btn1:hover{
background: white;
border: 1px solid;
color: black;
}
img{
}
</style>
</head>
<body>
<section class="form my-5 mx-5">
<div class="container">
<div class="row no-gutters">
<div class="col-lg-7 text-center">
</div>
<div class="col-5 px-5 pt-5">
<div class="">
</div>
<h3 class="my-3">Masuk</h3>
<form action="" method="POST">
<div class="form-row">
<div class="col-lg-8">
<input type="email" class="form-control my-3 p-2" placeholder="Email" name="email">
</div>
</div>
<div class="form-row">
<div class="col-lg-8">
<input type="password" class="form-control p-2" placeholder="Password" name="password">
</div>
</div>
<div class="input-group">
<button name="submit" class="btn1 mt-3 mb-4">Masuk</button>
</div>
<p class="login-register-text">Anda belum punya akun? <a href="daftar.php">Register</a></p>
</form>
</div>
</body>
</html>