Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. if ($username && $password) {
  2.  
  3. $connect = mysql_connect("localhost", "modernwx_paul", "*7w17T3r()") or die("Could not Connect!");
  4.  
  5. mysql_select_db("modernwx_prices") or die("Could not Find Data Base");
  6.  
  7.  
  8. $query = mysql_query("SELECT * FROM users WHERE username='$username'");
  9.  
  10. $numrows = mysql_num_rows($query);
  11.  
  12. if ($numrows != 0) {
  13.  
  14. while ($row = mysql_fetch_assoc($query)) {
  15.  
  16. $dbusername = $row['username'];
  17. $dbpassword = $row['password'];
  18.  
  19. }
  20. if ($username == $dbusername && $password == $dbpassword) {
  21.  
  22. header("Location: 'welcome.php'");
  23.  
  24. }
  25. else {
  26. echo "Incomplete password!";
  27. }
  28.  
  29.  
  30.  
  31. }
  32. else {
  33.  
  34. die("That user does not exist!");
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement