Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created March 1, 2016 13:45
Show Gist options
  • Save AndyNovo/8afe8f064e7a1f12edaf to your computer and use it in GitHub Desktop.
Save AndyNovo/8afe8f064e7a1f12edaf to your computer and use it in GitHub Desktop.
least secure login
<?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();
}
?>
<!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