daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Oct 23rd, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. session_start();
  4.  
  5. if ($username&&$password)
  6. {
  7.  
  8. $connect = mysql_connect("localhost","bbsd_publicsite","opens3sam3") or die("Could not connect to database");
  9. mysql_select_db("bbsd_publicsite") or die ("Could not find Database");
  10.  
  11. $query = mysql_query("SELECT * FROM users WHERE username='$username'");
  12.  
  13. $numrows = mysql_num_rows($query);
  14.  
  15. if ($numrows!=0)
  16. {
  17.  while ($row = mysql_fetch_assoc ($query))
  18.   {
  19.         $dbusername = $row['username'];
  20.         $dbpassword = $row['password'];
  21.   }
  22.  
  23.  // Check to see if they match!
  24.  if ($username==$dbusername&&md5 ($password==$dbpassword))
  25.   {
  26.      echo 'Successfully Logged in! <a href="member.php">Click here to enter the member page! </a>';
  27.      $_SESSION['username']=$username;
  28.  
  29.  }
  30.   else
  31.       echo "Incorrect Password!";
  32.  
  33.  }
  34. else
  35.     die("That user does not exist!");
  36.  
  37. }
  38.  
  39. else
  40.     die("Please enter a username and a password");
  41.  
  42. ?>
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