Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. enter code here
  2.  
  3. require_once('db.php');
  4.  
  5. $sql = 'SELECT * FROM users_table
  6. WHERE username="'.mysql_escape_string($uname).'" AND password="'.mysql_escape_string(md5($pw)).'"
  7. LIMIT 0, 1
  8. ';
  9. $qry = mysql_query($sql);
  10. $count = mysql_num_rows($qry);
  11.  
  12. if($count > 0) {
  13. $_SESSION['username'] = $uname;
  14. $_SESSION['password'] = $pw;
  15. header('Location: products_list.php');
  16. } else {
  17. header('Location: index.php?error=1');
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement