-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
94 lines (84 loc) · 3.38 KB
/
index.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
<?php
session_start();
if (isset($_SESSION['login']))
header('Location: dashboard.php');
include 'lhast.php';
include 'configdb.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">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<title><?php echo $_SESSION['judul']." - ".$_SESSION['welcome']." - oleh ".$_SESSION['by'];?></title>
<!-- Bootstrap core CSS -->
<link href="ui/css/materia.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="ui/css/signin.css" rel="stylesheet">
<script src="ui/js/es6-promise.auto.min.js"></script> <!-- IE support -->
<script src="ui/js/sweetalert2.js"></script>
<link rel="stylesheet" href="ui/css/sweetalert2.min.css">
<!-- jQuery 2.2.0 -->
<script src="ui/js/jQuery-2.2.0.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="ui/js/bootstrap.min.js"></script>
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<form class="form-signin" method="post" target="_self">
<center><h2 class="form-signin-heading">Silahkan Login</h2></center>
<label for="inputEmail" class="sr-only">Username</label>
<input type="text" name="user" id="user" class="form-control" placeholder="Username" required autofocus>
<br/>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" name="pass" id="pass" class="form-control" placeholder="Password" required>
<br/>
<button class="btn btn-md btn-primary btn-block" type="submit">Login</button>
</form>
</div> <!-- /container -->
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
if($_POST && $_POST['user']!='' && $_POST['pass']!=''){
$result = $mysqli->query("select * from user WHERE user = '".$_POST['user']."' and pass = '".hashku(1,$_POST['pass'])."'");
if(@$result->num_rows != 0){
while ($row = $result->fetch_assoc()) {
$_SESSION['login'] = 'KJHAbkfase86234809701234hgvbKHJGVYH%$&^$%&$^*';
$_SESSION['user'] = $row['user'];
$_SESSION['pass'] = $row['pass'];
}
header('Location: dashboard.php');
}
else { ?>
<script>
swal({
title: 'Login Error!',
text: 'Maaf Username atau Password salah..',
type: 'error',
confirmButtonText: 'OK'
})
</script>
<?php }
}
if(@$_POST['user']=='')
echo " username harus diisi..";
if(@$_POST['pass']=='')
echo " password harus diisi..";
}
?>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>