SHARE
TWEET

Untitled

a guest Jun 15th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include 'required.php';
  3.     $username = $_POST["username"];
  4.     $md5pass = md5($_POST['password']);    
  5.     mysql_select_db($dbname, $link) or die(mysql_error());
  6.         $rs2_duplicates = mysql_query("SELECT * FROM users WHERE username = '$username' AND banned = 'Y'");
  7.         $duplicates2 = mysql_num_rows($rs2_duplicates);
  8.         if ($duplicates2 > 0)
  9.         {
  10.                header("location: loginload.php?msg=Your Account is Banned. Please contact an Administrator to find out why.");
  11.                exit();
  12.         }
  13.     $query = "SELECT * FROM users WHERE username = '$username' AND password = '$md5pass'";
  14.         $result = mysql_query($query) or die(mysql_error());
  15.         if ($data_array = mysql_fetch_array($result))
  16.         {
  17.                 $rs_duplicates = mysql_query("SELECT * FROM users WHERE username = '$username' AND admin = 'Y'");
  18.                 $duplicates = mysql_num_rows($rs_duplicates);
  19.                 if ($duplicates > 0)
  20.                 {
  21.                         $expire=time()+60*60*24*30;
  22.                         setcookie("admin", $data_array['id'], $expire);
  23.                         setcookie("username", $data_array['username'], $expire);
  24.                 }
  25.                 $expire=time()+60*60*24*30;
  26.             setcookie("username", $data_array['username'], $expire);
  27.                 $dm = date("m");
  28.                 $dd = date("d");
  29.                 $dy = date("y");
  30.                 $jdate = "$dm/$dd/$dy";
  31.                 $query = "UPDATE profiles SET logged='$jdate' WHERE user='$username'";
  32.                 $result = mysql_query($query) or die(mysql_error());
  33.         header("location: loginload.php?msg=Thank you for logging in!");
  34.         } else {
  35.         header("Location: loginload.php?msg=Invalid Username or Password");
  36.     }
  37.     mysql_close($link);
  38.  
  39. ?>
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