Advertisement
irfanamir

register.php

Dec 14th, 2020
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. <?php
  2. include_once('db_connect.php');
  3. $database = new database();
  4. if(isset($_POST['register']))
  5. {
  6. $username = $_POST['username'];
  7. $password = password_hash($_POST['password'],PASSWORD_DEFAULT);
  8. $nama = $_POST['nama'];
  9. if($database->register($username,$password,$nama))
  10. {
  11. header('location:login.php');
  12. }
  13. }
  14.  
  15. ?>
  16. <!doctype html>
  17. <html lang="en" class="h-100">
  18. <head>
  19. <meta charset="utf-8">
  20. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  21. <meta name="description" content="">
  22. <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
  23. <meta name="generator" content="Jekyll v3.8.5">
  24. <title>Register Form</title>
  25.  
  26. <link rel="canonical" href="https://getbootstrap.com/docs/4.3/examples/sticky-footer/">
  27.  
  28. <!-- Bootstrap core CSS -->
  29. <link href="assets/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  30.  
  31.  
  32. <style>
  33. .bd-placeholder-img {
  34. font-size: 1.125rem;
  35. text-anchor: middle;
  36. -webkit-user-select: none;
  37. -moz-user-select: none;
  38. -ms-user-select: none;
  39. user-select: none;
  40. }
  41.  
  42. @media (min-width: 768px) {
  43. .bd-placeholder-img-lg {
  44. font-size: 3.5rem;
  45. }
  46. }
  47. </style>
  48. <!-- Custom styles for this template -->
  49. <link href="sticky-footer.css" rel="stylesheet">
  50. </head>
  51. <body class="d-flex flex-column h-100">
  52. <!-- Begin page content -->
  53. <main role="main" class="flex-shrink-0">
  54. <div class="container">
  55. <h1 class="mt-5">Register Form</h1>
  56. <p class="lead">Silahkan Daftarkan Identitas Anda</p>
  57. <hr/>
  58. <form method="post" action="">
  59. <div class="form-group row">
  60. <label for="username" class="col-sm-2 col-form-label">Username</label>
  61. <div class="col-sm-10">
  62. <input type="text" class="form-control" id="username" name="username" placeholder="Username">
  63. </div>
  64. </div>
  65.  
  66. <div class="form-group row">
  67. <label for="nama" class="col-sm-2 col-form-label">Nama</label>
  68. <div class="col-sm-10">
  69. <input type="text" class="form-control" id="nama" name="nama" placeholder="Nama">
  70. </div>
  71. </div>
  72.  
  73.  
  74. <div class="form-group row">
  75. <label for="password" class="col-sm-2 col-form-label">Password</label>
  76. <div class="col-sm-10">
  77. <input type="password" class="form-control" id="password" name="password" placeholder="Password">
  78. </div>
  79. </div>
  80. <div class="form-group row">
  81. <div class="col-sm-10">
  82. <a href="login.php" class="btn btn-success">Login</a>
  83. <button type="submit" class="btn btn-primary" name="register">Register</button>
  84. </div>
  85. </div>
  86. </form>
  87. </div>
  88. </main>
  89.  
  90. <footer class="footer mt-auto py-3">
  91. <div class="container">
  92. <span class="text-muted">nisa dan irfan &copy; 2021</span>
  93. </div>
  94. </footer>
  95. </body>
  96. </html>
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement