<?php
    $good 
true;
    include(
'mysql.php');
    
$key 'key{...}';
    
$auth false;
    
$admin false;
    if (
$_SERVER['REQUEST_METHOD'] == 'POST') {
        
$mysql->real_query('SELECT * FROM `csaw`.`users` WHERE `user` LIKE "' $mysql->real_escape_string($_POST['user']) . '";');
        if (
$mysql->errno != 0) {
            echo(
'Error.');
        } else {
            
$result $mysql->store_result();
            while (
$row $result->fetch_assoc()) {
                if ( 
$_POST['pass'] == $row['pass'] ) {
                    
$auth true;
                }
                if ( 
$row['user'] == 'Administrator' ) {
                    
$admin true;
                }
            }
        }
        if ( 
$auth && $admin ) {
            echo( 
$key );
        }
    }
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>CSAW</title>
</head>
<body>
    <h1>LOGIN</h1>
    <form method="post" action="login.php">
        <input type="text" name="user" placeholder="user" />
        <input type="text" name="pass" placeholder="pass" />
        <button type="submit">LOGIN</button>
    </form>
</body>
</html>