52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
// Set your desired password here
|
|
$correctPassword = 'chillinglittlebit'.date("d");
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
$inputPassword = $_POST['password'] ?? '';
|
|
|
|
if ($inputPassword === $correctPassword) {
|
|
$_SESSION['authenticated'] = true;
|
|
header('Location: index.php'); // Reload to show the two buttons
|
|
exit;
|
|
} else {
|
|
$error = "❌ Incorrect password.";
|
|
}
|
|
}
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Login</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
</head>
|
|
<body class="bg-light">
|
|
|
|
<div class="container mt-5">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-5">
|
|
|
|
<h2 class="mb-4 text-center">🔐 Please Login</h2>
|
|
|
|
<?php if (!empty($error)): ?>
|
|
<div class="alert alert-danger"><?= htmlspecialchars($error) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<form method="POST" class="card p-4 shadow-sm bg-white">
|
|
<div class="mb-3">
|
|
<label for="password" class="form-label">Password</label>
|
|
<input type="password" class="form-control" name="password" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary w-100">Login</button>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|