Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php>
  2.  
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5.  
  6. if ($username&&$password)
  7. {
  8.  
  9. $connect = mysql_connect("mysql17.000webhost.com","a9703423_george","fatlard1") or die("Could not connect!");
  10. mysql_select_db("a9703423_login") or die("Could not find db");
  11.  
  12. $query = mysql_query("SELECT * FROM users WHERE username='$username'");
  13.  
  14. $numrows = mysql_num_rows($query);
  15.  
  16. if ($numrows!=0)
  17. {
  18. while ($row =mysql_fetch_assoc($query))
  19. {
  20. $dbusername = $row['username'];
  21. $dbpassword = $row['password'];
  22. }
  23.  
  24. // check to see if they match!
  25. if ($username==$dbusername&&$password==$dbpassword
  26. {
  27. echo "Your in!";
  28. }
  29. else
  30. echo "Incorrect password!";
  31. {
  32.  
  33. }
  34.  
  35. }
  36. else
  37. die("That user does not exist");
  38.  
  39. }
  40. else
  41. die("Please enter a username and password");
  42.  
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement