Created
September 10, 2010 02:27
-
-
Save cvonkleist/572964 to your computer and use it in GitHub Desktop.
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 | |
require "inc/mysql.inc.php"; | |
?> | |
<html> | |
<head><title>Oh, Those Admins!</title></head> | |
<body><center><h1>Oh, hi!</h1> | |
<?php | |
if (isset($_GET['password'])) { | |
$r = mysql_query("SELECT login FROM admins WHERE password = '" . md5($_GET['password'], true) . "'"); | |
if (mysql_num_rows($r) < 1) | |
echo "Oh, you shall not pass with that password, Stranger!"; | |
else { | |
$row = mysql_fetch_assoc($r); | |
$login = $row['login']; | |
echo "Oh dear, hello <b>$login</b>!<br/><br/>Oh, and here's the list of all Admins!<table border=1><tr><td>Oh, login!</td><td>Oh, password!</td></tr>"; | |
$r = mysql_query("SELECT * FROM admins"); | |
while ($row = mysql_fetch_assoc($r)) | |
echo "<tr><td>{$row['login']}</td><td>{$row['password']}</td></tr>"; | |
echo "</table>"; | |
} | |
} else { | |
?> | |
<form>Oh, give me your password, Admin!<br/><br/><input type='text' name='password' /><input type='submit' value='»' /></form> | |
<?php | |
} | |
?> | |
<br/><br/><small>Oh, © 2010 vos!</small></center></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment