Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
806
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. //DB connection up here.
  3. $username = $_POST["Username"];
  4. $password = $_POST["Password"];
  5.  
  6. $username = htmlspecialchars($username);
  7. $password = htmlspecialchars($password);
  8.  
  9. $username = mysqli_real_escape_string($dbconfig,$username);
  10. $password = mysqli_real_escape_string($dbconfig,$password);
  11.  
  12. $query = "SELECT * FROM users WHERE Username = '$username' AND Password = '$password' LIMIT 1";
  13. $result = mysqli_query($dbconfig,$query);
  14. $rows = mysqli_num_rows($result);
  15. if($rows >= 1) {
  16. header('Location: home.php');
  17. } else {
  18. echo "Username/Password not found.";
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement