Advertisement
Guest User

Untitled

a guest
Feb 17th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include "koneksi.php";
  4. $user = $_POST['username'];
  5. $pass = $_POST['password'];
  6. $login = $_POST['login'];
  7.  
  8. if ($login) {
  9. if ($user == "" && $pass == "") {
  10. echo "<script type='text/javascript'>alert('Username & Password Empty')</script";
  11. }
  12. else {
  13. $sql = mysqli_query("select * from login where username = '$user' and password = md5('$pass') ") or die(mysql_error());
  14. $data = mysqli_fetch_array($sql);
  15. $cek = mysqli_num_rows($sql);
  16. if ($cek >= 1) {
  17. echo "Login Berhasil";
  18. }
  19. else{
  20. echo "Login Gagal";
  21. }
  22. }
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement