SHARE
TWEET

Untitled

a guest Jun 15th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <form name="login" method="post" action="login.php">
  2.   <label for="user"></label>
  3.   <input name="user" type="text" id="user" value="user">
  4.   <input name="pass" type="password" id="user2" value="passwd">
  5.   <input type="submit" name="submit" id="submit" value="Submit">
  6. </form>
  7.  
  8. <?php
  9.  
  10. if ($_POST['submit']) {
  11.  
  12.     $user = $_POST['user'];
  13.    
  14.     $passmd5 = md5("$salt.$pass");
  15.     $usercheck = mssql_query("SELECT * FROM ACCOUNT_TBL WHERE account='$user' AND password='$passmd5'");
  16.     $checkaccount = mssql_num_rows($usercheck);
  17.            
  18.     if ($checkaccount >= 1)
  19.     {
  20.         //Last ip
  21.         $logip = mssql_query("UPDATE ACCOUNT_TBL SET lastip = '$ip' WHERE account = '$user' AND password = '$passmd5'");
  22.         // Using sessions
  23.         $_SESSION['account'] = $user;
  24.         $_SESSION['password'] = $passmd5;
  25.        
  26.         session_register("login");
  27.        
  28.         //Redirection to user panel
  29.         echo "LOGGED IN";
  30.     }
  31.     else if ($checkaccount != 1)
  32.     {
  33.         echo "<font color='red'>Wrong username or password!</font>";
  34.     }
  35. }
  36. ?>
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