Created
March 1, 2016 13:45
-
-
Save AndyNovo/8afe8f064e7a1f12edaf to your computer and use it in GitHub Desktop.
least secure login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$username = $_REQUEST["username"]; | |
$pwd = $_REQUEST["password"]; | |
if ($username == "andy" && $pwd == "rules") { | |
$_SESSION["logged_in"] = true; | |
echo "You logged in!"; | |
} else { | |
$_SESSION["logged_in"] = false; | |
header("Location: index.html"); /* Redirect browser */ | |
exit(); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Least Secure Login</title> | |
</head> | |
<body> | |
<form action="auth.php" method="get"> | |
<input type="text" name="username" placeholder="username, e.g. admin"></input> | |
<input type="password" name="password" placeholder="password"></input> | |
<button type="submit">Send form</button> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment