Advertisement
Guest User

Untitled

a guest
Aug 5th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <?php include 'header.php' ?>
  2. <div class="container center-block">
  3. <div class="panel panel-default center-block" style="max-width:600px;margin-top:70px">
  4. <div class="panel-heading">
  5. <h3 class="panel-title">Login Form</h3>
  6. </div>
  7. <div class="panel-body">
  8. <form action="" method="POST" class="form-horizontal">
  9. <div class="form-group">
  10. <label for="username" class="col-sm-4 control-label">Username</label>
  11. <div class="col-sm-8">
  12. <input type="text" name="username" id="username" class="form-control">
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <label for="password" class="col-sm-4 control-label">Password</label>
  17. <div class="col-sm-8">
  18. <input type="password" name="password" id="password" class="form-control">
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <div class="col-sm-offset-2 col-sm-10">
  23. <input type="submit" name="submit" class="btn btn-primary" value="Login">
  24. </div>
  25. </div>
  26. </form>
  27. <?php
  28. if (isset($_POST['submit'])) {
  29. $username = 'administrator';
  30. $password='123456';
  31. if ($_POST['username'] ==$username && $_POST['password']==$password) {
  32. $_SESSION['username']=$_POST['username'];
  33. $_SESSION['akses']='admin';
  34. header('Location:data.php');
  35. }else{
  36. $message = "Password atau username salah";
  37. }
  38. }
  39. ?>
  40. <?php if (isset($message)): ?>
  41. <div class="alert alert-danger">
  42. <?php echo $message ?>
  43. </div>
  44. <?php endif ?>
  45. </div>
  46. </div>
  47. </div>
  48. <?php include 'footer.php' ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement