RyanHub - file viewer
filename: admin.php
branch: main
back to repo
<?php 
$pass = "bigpasswordguy";
?>

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="IHEARTCOMPUTER - A club for computer lovers at NJIT">
  <title>IHEARTCOMPUTER</title>
  <link rel="icon" type="image/x-icon" href="logo.png">
  <style>
    body {
      display: flex;
      flex-direction: column;
      margin: 20px;
      border: 1px solid #333;
      padding: 10px;
    }
    .small { font-size: 1.0rem; align-self: center; }
    .medium { font-size: 1.5rem; align-self: center; }
    .large { font-size: 2.0rem; }
    .link { color: blue; }
    .break { width:100%;margin:20px auto; }
    .header {
      width: 100%;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }
    .title {
      max-width: 60%;
      display: flex;
      flex-direction: column;
      flex: 1;
    }
    .nav {
      display: flex;
      flex-direction: row;
      gap: 15px;
      margin: 10px;
    }
    @media (max-width: 600px) {
      .nav {
        display: none;
      }
      .title {
        max-width: 100%;
      }
      .header {
        flex-direction: column;
      }
    }
    .content {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }
    button, input {
      background-color: whitesmoke;
      border: solid 1px lightgrey;
      border-radius: 5px;
      color: grey;
      padding: 5px;
    }
    button:hover, input:hover {
      border: solid 1px black;
    }

  </style>
</head>
<body>
  <div class="main">
    <header class="header">
      <div class="title">
        <strong class="large">I<span style="color: #e00;">♥</span>COMPUTER</strong>
      </div>
      <nav class="nav">
        <a class="link" href="index.php">home</a>
        <a class="link" href="https://discord.gg/JpRw84Ybwg" target="_blank">discord</a>
        <a class="link" href="">third link</a>
      </nav>
    </header>

    <hr class="break">

    <div class="content">

	<?php
	  if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['password']) && trim($_POST['password']) == $pass) {
	    echo file_get_contents('subscribers.txt');
	  } else {
 	?>
          <form method="post" action="">
            <label class="small">password:
              <input class="small" name="password" required>
            </label>
            <button class="small" type="submit">submit</button>
          </form>
	<?php
	 }
	?>

    </div>
  </div>
</body>
</html>