Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //DB connection up here.
- $username = $_POST["Username"];
- $password = $_POST["Password"];
- $username = htmlspecialchars($username);
- $password = htmlspecialchars($password);
- $username = mysqli_real_escape_string($dbconfig,$username);
- $password = mysqli_real_escape_string($dbconfig,$password);
- $query = "SELECT * FROM users WHERE Username = '$username' AND Password = '$password' LIMIT 1";
- $result = mysqli_query($dbconfig,$query);
- $rows = mysqli_num_rows($result);
- if($rows >= 1) {
- header('Location: home.php');
- } else {
- echo "Username/Password not found.";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement