Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php include ('db.php');
  2.  
  3. $blank = NULL;
  4. $username = $_POST['username'];
  5. $password = $_POST['password'];
  6.  
  7.  
  8. $user = mysql_real_escape_string($username);
  9. $pass = mysql_real_escape_string($password);
  10.  
  11. $encryptpass=md5($pass);  
  12.  
  13. $result = mysql_query("SELECT * FROM users WHERE username='$user' AND password='$encryptpass' limit 1");
  14.  
  15. if (mysql_num_rows($result)){
  16. session_start("samwilki");
  17. $_SESSION["samwilki"] = true;
  18. header('Location: /home.php');
  19. } else {
  20. header('Location: /index.php?err=baddetails');
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement