Advertisement
Guest User

Untitled

a guest
Jun 17th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. <?php
  2. include 'mysql-connect.php';
  3.  
  4. $username = $_POST['user'];
  5. $password = $_POST['pass'];
  6. $query1 = mysql_query("SELECT * FROM users WHERE username='$username'");
  7. $result = mysql_num_rows($query1);
  8. if($result == 0)
  9. {
  10. include '<h1>Error!</h1>The username you specified does not exist!';
  11. }
  12. else
  13. {
  14.  
  15. $checkuser = mysql_query("SELECT * FROM users WHERE username='$username'");
  16.  
  17.                         $row = mysql_fetch_array($checkuser);
  18.                                                         $password2 = $row['password'];
  19.                                                         $status = $row['status'];
  20.                                 if ($password == $password2)
  21.                                         {
  22.                                         //PUT PASSWORD PROTECTED INFORMATION HERE
  23.                                         }
  24.                                 else
  25.                                         {
  26.                                         echo '<h1>Error!</h1>The username and password combination you entered does not match the ones we have in the database.';
  27.                                         }
  28.  
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement