SHARE
TWEET

Untitled

a guest Jan 15th, 2020 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include 'lib/library.php';
  3.  
  4. sudahLogin();
  5.  
  6. if ($_SERVER['REQUEST_METHOD'] == "POST") {
  7.     $username = $_POST['username'];
  8.     $password = $_POST['password'];
  9.  
  10.     $sql = "SELECT * FROM login WHERE username = '$username' AND password = sha1('$password')";
  11.  
  12.     $data = $conn -> query($sql) or die($conn->error);
  13.  
  14.     if ($data->num_rows != 0) {
  15.         $row = mysqli_fetch_object($data);
  16.         $_SESSION['username'] = $row->username;
  17.         $_SESSION['level'] = $row->level;
  18.         header("location:index.php");
  19.     }else{
  20.         $error = "Username atau password salah";
  21.     }
  22. }
  23. include 'views/v_login.php';
  24. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top