Skip to content

Instantly share code, notes, and snippets.

@simonszu
Created June 16, 2015 17:41
Show Gist options
  • Save simonszu/6b5f1a3083bf039d6cb3 to your computer and use it in GitHub Desktop.
Save simonszu/6b5f1a3083bf039d6cb3 to your computer and use it in GitHub Desktop.
A password checker for PHP
<?php
$username = "user";
$password = "password";
if ((!isset($_POST["user"])) && (!isset($_POST["pw"]))){
echo "<form action=\"secure.php\" method=\"post\">";
echo "username: <input type=\"text\" name=\"user\"><br />";
echo "password: <input type=\"password\" name=\"pw\">";
echo "<input type=\"submit\" value=\"Abschicken\">";
echo "</form>";
}
else if ((isset($_POST["user"])) && (isset($_POST["pw"])) && ($_POST["user"] == $username) && ($_POST["pw"] == $password)){
echo "Hier steht sicheres zeug";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment