Advertisement
Guest User

Untitled

a guest
Mar 4th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2. $id_user=sess("id_user");
  3. if($id_user){
  4. redirect("index.php");
  5. return false;
  6. };
  7. ?>
  8. <div class="tabel-login" id="tabel-login">
  9. <a href="index.php"><div class="out"><h6 class="h6-out">keluar</h6></div></a>
  10. <form class="form-login" method="post">
  11. <label>Username :</label><br>
  12. <input type="text" name="username" class="in-login" required="required"><br>
  13. <label>Password :</label><br>
  14. <input type="password" name="pass" class="in-login" ><br>
  15. <input type="submit" value="Login" name="btn-login" class="btn-login">
  16. </form>
  17. <?php
  18. if(isset($_POST["btn-login"])){
  19. extract($_POST);
  20. $pass=md5($pass);
  21. $select=select("user where username='$username' or password='$pass'");
  22. if(nur($select)>0){
  23. $hasil=fetc($select);
  24. if($hasil["status"]=="Belum aktif"){
  25. alert("Maaf.! Moho tunggu pengaktifan akun anda.");
  26. }else{
  27. $_SESSION["id_user"]=$hasil["id_user"];
  28. $_SESSION["username"]=$hasil["username"];
  29. $_SESSION["email"]=$hasil["email"];
  30. $url=get("url");
  31. if($url)redirect("?hal=$url");
  32. else redirect("index.php");
  33. }
  34. }
  35. else
  36. {
  37. alert("email atau password salah");
  38. }
  39. }
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement