Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( count($errors) == 0 )
- {
- $password = md5($password);
- $query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
- $results = mysqli_query($db, $query);
- if ( mysqli_num_rows($results) == 1 )
- {
- $_SESSION['username'] = $username;
- $_SESSION['success'] = "You are now logged in";
- header('location: index.php');
- }
- else
- {
- array_push($errors, "Wrong username/password combination");
- }
- }
Advertisement
RAW Paste Data
Copied
Advertisement