Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. // Script By Andre Gatami
  3. session_start();
  4. require_once("koneksi.php");
  5. $username = $_POST['username'];
  6. $pass = md5(base64_decode(base64_decode(base64_decode($_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.php?pesan=1&isi=Username : $username belum terdaftar.");
  12. } else {
  13. if($pass !== $hasil['password']) {
  14. header("location:index.php?pesan=1&isi=Password yang anda masukkan salah.");
  15. } else {
  16. $_SESSION['username'] = $hasil['username'];
  17. header('location:/');
  18. }
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement