Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. function ceklogin_member($datalogin)
  2. {
  3. global $conn;
  4. $username = $datalogin["username"];
  5. $password = $datalogin["password"];
  6. $cekuser = mysqli_query($conn, "SELECT * FROM register_akun WHERE username='$username' or email='$username'");
  7.  
  8. if (mysqli_num_rows($cekuser) === 1) {
  9. $hasil = mysqli_fetch_assoc($cekuser);
  10. if (password_verify($password, $hasil["password"])) {
  11. $_SESSION["username"] = $username;
  12. $_SESSION["login"] = true;
  13.  
  14. if (isset($datalogin["rememberme"])) {
  15. setcookie("login", "tetap_ingat", time() + 30);
  16. }
  17. echo "<script>
  18. alert('Anda berhasil login!');
  19. document.location.href='servicecustomer.php';
  20. </script>";
  21. }
  22. } else {
  23. print "<p style=\"color:red; font-style: italic;\"> Username / Password Salah !</p>";
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement