Skip to content

Instantly share code, notes, and snippets.

@IhwanID
Created August 31, 2018 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IhwanID/f132ee9b5d27a4b83947e9cf6d010b01 to your computer and use it in GitHub Desktop.
Save IhwanID/f132ee9b5d27a4b83947e9cf6d010b01 to your computer and use it in GitHub Desktop.
<?php
session_start();
include_once('config.php');
$judul = "Login";
$subjudul = "";
$url_banner = "assets/img/home-bg.jpg";
if(isset($_POST['submit'])){
$username = "admin";
$password = "admin";
if($_POST['username'] == $username && $_POST['password'] == $password){
$_SESSION['loggedin'] = true;
header('Location: index.php');
}else{
exit('login gagal');
}
}
?>
<?php include('header.php'); ?>
<!-- Main Content -->
<div class="container">
<form action="login.php" method="post">
<label >Username</label>
<input type="text" name="username" class="form-control">
<br>
<label>Password</label>
<input type="password" name="password" class="form-control">
<hr>
<button type="submit" name="submit" value="submit">Login</button>
</form>
</div>
<?php include('footer.php'); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment