daily pastebin goal
94%
SHARE
TWEET

Untitled

a guest Jul 21st, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php require("header.php"); ?>
  2. <div class="post">
  3.     <h1 class="title">Login </h1>
  4.     <p class="byline"><small>go <a href="/register.php">here</a> if you aren't a member</small></p>
  5.     <div class="entry">
  6.         <?php
  7.     if($_POST) {
  8.             $password_given = md5($_POST["password"]);
  9.         $username_given = $_POST["username"];
  10.             $exist = 0;
  11.             $result = mysql_query("select * from users");
  12.             while($row = mysql_fetch_array($result)){
  13.                 if ($row["username"] == $username_given)
  14.                     { $row["password"] = $pass; }
  15.             }
  16.         echo $pass." difference ".$password_given;
  17.         if ($password_given == $pass)
  18.         {
  19.         echo "Success!";
  20.         }
  21.                 elseif (($_POST["password"] == NULL)
  22.                     ||($_POST["username"] == NULL)
  23.             ||($exist == 0))
  24.                 {
  25.             echo "Nope. Zero on the final.";
  26.                 }
  27.                 else
  28.                 {
  29.                     echo "Something went wrong.";
  30.                 }
  31.        }
  32.             else echo '<form action="login.php" method="post">
  33.            <div>username: </div><input type="text" name="username" />
  34.            <div>password: </div><input type="password" name="password" />
  35.            <input type="submit" />
  36.            </form>';
  37.         ?>
  38.     </div>
  39. </div>
  40. <?php require("footer.php"); ?>
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