Advertisement
Guest User

Untitled

a guest
Jul 10th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2. // Script by Denny Irawan
  3. session_start();
  4. require_once("koneksi.php");
  5. $username = $_POST['username'];
  6. $pass = $_POST['password'];
  7. $cekuser = mysql_query("SELECT * FROM user WHERE username = '$username'");
  8. $jumlah = mysql_num_rows($cekuser);
  9. $hasil = mysql_fetch_array($cekuser);
  10. if($jumlah == 0) {
  11. header("location:index.html?Username:belum-terdaftar.");
  12. } else {
  13. if($pass <> $hasil['password']) {
  14. header("location:index.html?Password=Salah");
  15. } else {
  16. $_SESSION['username'] = $hasil['username'];
  17. header('location:/home');
  18. }
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement