Advertisement
niwakun012

login.php

Mar 4th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. include_once('config.php');
  5.  
  6. $username = $_POST['uname'];
  7. $password = $_POST['pw'];
  8.  
  9. $data = mysqli_query($conn, "SELECT * FROM kasir where username='$username' and password='$password'");
  10.  
  11. $cek = mysqli_num_rows($data);
  12.  
  13. if($cek>0){
  14. $_SESSION['uname'] = $username;
  15. $_SESSION['status'] = "login";
  16. header("location:barang.php");
  17. }else{
  18. header("location:index.php?pesan=gagal");
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement