Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'inc/function.php';
- if (isset($_POST["login"]) ) {
- $user = $_POST['user'];
- $pass = $_POST['pass'];
- $result = mysqli_query($con, "SELECT * FROM tb_user WHERE username = '$user'" );
- //cek username
- if (mysqli_num_rows($result) === 1 ) {
- //cek password
- $row = mysqli_fetch_assoc($result);
- if (password_verify($pass, $row["password"])){
- header("location: index.php?info");
- exit;
- }
- }
- $error = true;
- }
- ?>
- <link rel="stylesheet" type="text/css" href="css/in.css">
- <body>
- <?php if ( isset($error)): ?>
- <script type="text/javascript">alert("password dan username salah");</script>
- <?php endif ?>
- <div id="canvas">
- <div class="judul">
- FORM LOGIN
- </div>
- </div>
- <form action="" method="post" class="in">
- <p style="margin-top: 40px;">
- <input type="text" name="user" placeholder="Username" class="input" />
- </p>
- <p style="margin-top: 20px;">
- <input type="password" name="pass" placeholder="Password" class="input" />
- </p>
- <a href="" class="l">Lupa Password</a>
- <input type="submit" value="SING IN" class="tombol" name="login" />
- <p class="akun">Belum Punya Akun
- <a href="index.php?regis" class="up">SING UP</a>
- </p>
- </form>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement