Guest User

Untitled

a guest
Mar 17th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5.  
  6. $query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
  7. $result = mysql_query($query);
  8. $numrows = mysql_num_rows($result);
  9.  
  10. if($numrows == 1)
  11. {
  12. $row = mysql_fetch_array($result, MYSQL_ASSOC);
  13.  
  14. session_start();
  15. $_SESSION['logged_in'] = true; //Is this a BAD BAD thing to do?
  16.  
  17. ?>
Add Comment
Please, Sign In to add comment