Guest User

Untitled

a guest
Sep 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. $query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
  2. $results = mysqli_query($db, $query);
  3. if (mysqli_num_rows($results) == 1) {
  4.  
  5.  
  6. $_SESSION['email'] = $email;
  7. $_SESSION['username'] = $username;
  8. $_SESSION['success'] = "You are now logged in";
  9. header('location: index.php');
  10.  
  11. <?php
  12. // Echo session variables that were set on previous page
  13. echo "Your email is: " . $_SESSION['email'] . "<br>";
  14. echo "Your username is: " . $_SESSION['username'] . "";
  15. ?>
Add Comment
Please, Sign In to add comment