Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require("header.php"); ?>
- <div class="post">
- <h1 class="title">Login </h1>
- <p class="byline"><small>go <a href="/register.php">here</a> if you aren't a member</small></p>
- <div class="entry">
- <?php
- if($_POST) {
- $password_given = md5($_POST["password"]);
- $username_given = $_POST["username"];
- $exist = 0;
- $result = mysql_query("select * from users");
- while($row = mysql_fetch_array($result)){
- if ($row["username"] == $username_given)
- { $row["password"] = $pass; }
- }
- echo $pass." difference ".$password_given;
- if ($password_given == $pass)
- {
- echo "Success!";
- }
- elseif (($_POST["password"] == NULL)
- ||($_POST["username"] == NULL)
- ||($exist == 0))
- {
- echo "Nope. Zero on the final.";
- }
- else
- {
- echo "Something went wrong.";
- }
- }
- else echo '<form action="login.php" method="post">
- <div>username: </div><input type="text" name="username" />
- <div>password: </div><input type="password" name="password" />
- <input type="submit" />
- </form>';
- ?>
- </div>
- </div>
- <?php require("footer.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement