Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <title>Aplikasi Sistem Informasi Kepegawaian</title>
- <?php
- include 'koneksi.php';
- include 'header.php';
- if(isset($_POST['username']) and isset($_POST['password'])) {
- $username = $_POST['username'];
- $password = md5($_POST['password']);
- $query = mysqli_query($koneksi, "SELECT count(*) as jml FROM user "
- . " where username = '{$username}' and password = '{$password}'");
- $check = mysqli_fetch_array($query);
- if($check['jml']>0) {
- $_SESSION['simak_login'] = TRUE;
- header("location:index.php");
- }
- else {
- $_SESSION['msg'] = "Maaf username atau password anda salah";
- $_SESSION['simak_login'] = FALSE;
- header("location:login.php");
- }
- }
- else {
- if(isset($_SESSION['msg']) and $_SESSION['msg']!='') {
- echo '<script>alert("'. $_SESSION['msg'].'");</script>';
- $_SESSION['msg'] = '';
- }
- ?>
- <h1>Form Login</h1>
- <div class="container-fluid">
- <form method="post" action="login.php" >
- <div class="form-group row">
- <label class="col-sm-2 col-form-label">username </label>
- <div class="col-sm-3">
- <input required type="text" class="form-control" name="username" />
- </div>
- </div>
- <div class="form-group row">
- <label class="col-sm-2 col-form-label">password </label>
- <div class="col-sm-3">
- <input required type="password" class="form-control" name="password" />
- </div>
- </div>
- <div class="form-group row">
- <label class="col-sm-2 col-form-label"> </label>
- <div class="col-sm-3">
- <input class="btn btn-primary" type="submit" value="LOGIN" />
- </div>
- </div>
- </form>
- </div>
- <?php } ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement