Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2. include "koneksi.php";
  3. $username = $_POST['user'];
  4. $password = $_POST['pass'];
  5. $nip = $_POST['nip'];
  6.  
  7. $query = mysql_query("SELECT COUNT(username) AS jumlah FROM tb_user
  8. WHERE username='$username' AND password='".md5( $password )."'");
  9. $data = mysql_fetch_array($query);
  10. $nip=$_POST['nip'];
  11. if ($data['jumlah'] >= 1){
  12. session_start();
  13. $_SESSION['username'] = $username;
  14. $_SESSION['password'] = $password;
  15. $_SESSION['nip'] = $nip;
  16. $username = $_SESSION['username'];
  17.  
  18. header('location:admin/index.php');
  19. } else {
  20. header('location:index.html');
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement