Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once("php/config.php");
- session_start();
- if($_SERVER["REQUEST_METHOD"] == "POST")
- {
- $username = mysqli_real_escape_string($connection, $_POST['Username']);
- $password = mysqli_real_escape_string($connection, $_POST['Password']);
- $sql = "SELECT id FROM LoginCredentials WHERE Username = '$username' and Password = '$password'";
- $result = mysqli_query($connection, $sql);
- $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
- $active = $row['active'];
- $count = mysqli_num_rows($result);
- if ($count == 1)
- {
- session_register($username);
- $_SESSION['login_user'] = $username;
- header('location: home.php');
- }
- else
- {
- $error = "Incorrect username or password.";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement