Skip to content

Instantly share code, notes, and snippets.

@wrossmann
Created December 18, 2013 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrossmann/8030953 to your computer and use it in GitHub Desktop.
Save wrossmann/8030953 to your computer and use it in GitHub Desktop.
<?php
require('creds.php');
if( isset($creds[$_POST['user']]) && ($creds[$_POST['user']] == md5($_POST['pass'])) ) {
echo "Authenticated";
} else {
echo <<<_eoi_
<form action="" method="POST">
<input name="user" type="text" />
<input name="pass" type="password" />
<input type="submit" />
</form>
_eoi_;
}
<?php
$creds = array(
'gordian' => 'ea702ba4205cb37a88cc84851690a7a5'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment