Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 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("localhost","beastt_login","") or die("Connection FAIL");
  10. mysql_select_db("beastt_LoginDB") or die("couldnt find DB");
  11.  
  12. $query = mysql_query("SELECT * FROM users WHERE username='$username'");
  13.  
  14. $numrow = 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.     //check to see if they match!
  24.     if ($username==$dbusername&&$password==$dbpassword)
  25.     {
  26.     echo "Your In!";
  27.     }
  28.     else
  29.         echo "Incorrect password!";
  30.  
  31.    
  32. }
  33. else
  34.     die("Please enter an username and password");
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement