Advertisement
Guest User

Untitled

a guest
Jul 18th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $loginpopup = 'Login Success';
  5. $failpopup = 'Wrong Username or Password';
  6. if(!$con)
  7. {
  8. die("Error connection" . mysqli_connect_error());
  9.  
  10. }
  11. if (isset($_POST['submitlogin']))
  12. {
  13.  
  14. $login = "SELECT * from admin where username = '$_POST[user]' AND password ='$_POST[pass]'";
  15.  
  16. $getuser = mysqli_query($con,$login) or die(mysql_error());
  17. while($row = mysqli_fetch_array($getuser))
  18. {
  19. if($row==0)
  20. {
  21. echo "<SCRIPT>alert('$failpopup');</SCRIPT>";
  22. header("location:index.php");
  23. }
  24. else
  25. {
  26. echo "<SCRIPT>alert('$loginpopup');</SCRIPT>";
  27. header("location:home.php");
  28. }
  29. }
  30. }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement