');
}
echo 'heres the admin world
';
echo '';
echo '';
echo '
';
$showForm = true;
if(isset($_GET['user']) ) {
if(!isset($_POST['username']) || empty($_POST['username'])) {
$error = "Enter the username";
} else {
$statement = $pdo->prepare("SELECT * FROM users WHERE username = :username");
$result = $statement->execute(array('username' => $_POST['username']));
$user = $statement->fetch();
if($user === false) {
$error = "no user found";
} else {
$showForm = false;
echo 'The User '.$user['username'].' with the ID '.$user['id'].' has:';
if($user['isadmin'] == "0"){
echo "
no admin rights";
} if($user['isadmin'] == "1"){
echo "
ADMIN RIGHTS!";
} else {
echo "
A faulty user.";
}
}
}
}
if($showForm):
?>
Search for Admin Rights!
Please enter the username below.
echo '
';
echo '';
?>