Advertisement
LexPadang

Coba

Jan 12th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2. $sambung=mysqli_connect("localhost","root","","login");
  3. $user=$_POST['user'];
  4. $pass=$_POST['password'];
  5. $cari=mysqli_query($sambung,"select * from login_admin where user_name='$user' and user_pass='$pass'") or die ("Gagal");
  6. $lihat=mysqli_num_rows($cari);
  7. if (isset($_POST['submit']))
  8. {
  9. if (empty($user) and empty($pass))
  10. {
  11. echo "User name dan Password tidak boleh kosong";
  12. }
  13. elseif ($lihat<1) {
  14. echo "Username dan Password Salah";
  15. }
  16. else
  17. {
  18. session_start();
  19. $_SESSION['password']=$pass;
  20. header("location:admin.php");
  21. }
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement