Guest User

Untitled

a guest
Apr 7th, 2016
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php // Script by Kevin Lesmart
  2. session_start();
  3. require_once("koneksi.php");
  4. $username = $_POST['username'];
  5. $password = $_POST['password'];
  6. $cekuser = mysql_query("SELECT * FROM user WHERE username = '$username'");
  7. $jumlah = mysql_num_rows($cekuser);
  8. $hasil = mysql_fetch_array($cekuser);
  9. if($jumlah == 0) {
  10. header("location:/login.php?pesan=1&isi=Username $username belum terdaftar.");
  11. } else {
  12. if($password <> $hasil['password']) {
  13. header("location:/login.php?pesan=2&isi=Password yang anda masukkan salah.");
  14. } else {
  15. $_SESSION['username'] = $hasil['username'];
  16. header('location:/index.php');
  17. }
  18. }
  19. ?>
Add Comment
Please, Sign In to add comment