SHARE
TWEET

Untitled

a guest Jun 14th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.  
  4. if (isset($_POST['username']))
  5. {
  6.  
  7. $username = $_POST['username'];
  8. $password = $_POST['password'];
  9.  
  10.  
  11.  
  12. $connect = mysql_connect("localhost","a26_flroot","plates123") or die("Couldn't Connect.");
  13. mysql_select_db("a26_flogin") or die("Couldn't connect.");
  14.  
  15. $select = "SELECT * FROM users WHERE username = '$username' AND password='$password'";
  16.  
  17. $query = mysql_query($select);
  18.  
  19. $numrows = mysql_num_rows($query);
  20.  
  21. if ($numrows==0)
  22. {
  23. /*
  24.    while ($row = mysql_fetch_assoc($query))
  25.    {
  26.          $dbusername = $row['username'];
  27.          $dbpassword = $row['password'];
  28.    }
  29.    
  30.    // check to see if they match!
  31.    if ($username==$dbusername&&$password==$dbpassword)
  32.    {
  33. */
  34.     echo "Welcome back, <a href='/login/member.php'>Member</a>";
  35.         setcookie('username',$username,time()+7200, '/');
  36.    
  37.  
  38.     $_SESSION['username']==$dbusername;
  39. /*
  40.    }
  41.    else
  42.        echo "Incorrect password!";
  43. */
  44. }
  45. else
  46. die("That user doesnt exist!");
  47.  
  48.  
  49.  
  50. }
  51. else
  52.    die("Please enter an username and password.");
  53.  
  54.  
  55.  
  56.  
  57. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top