Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 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. {
  28.  else
  29.     echo "Incorrect password!";
  30.  
  31.  {
  32.  
  33.  
  34.  }
  35.  else
  36.     die("That user does not exist");
  37.  
  38. }
  39.  else
  40.     die("Please enter a username and password");
  41.  
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement