Advertisement
Guest User

Untitled

a guest
Feb 14th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1.  
  2.  
  3. <?php
  4.  
  5. include 'koneksidb.php';
  6. $username= $_POST['username'];
  7. $password= md5 ($_POST['password']);
  8. $sql=mysql_query("select *from tbkaryawan where username='$username' and password='$password'");
  9. $cari = mysql_num_rows($sql);
  10. $record = mysql_fetch_array($sql);
  11. if ($cari>0){
  12.  
  13. $_SESSION['username']=$record['username'];
  14. $_SESSION['password']= $record['password'];
  15. $_SESSION['nama']=$record['nm_karyawan'];
  16. echo "<script>alert ('Login Sukses');
  17. location='index2.php'</script>";
  18. }
  19. else {
  20. echo "<script>alert ('Password Username Salah');history.go(-1)</script>";
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement