36320-vm/admin_login.php
Flatlogic Bot e899fb7f07 1.0
2025-11-26 18:47:09 +00:00

63 lines
2.0 KiB
PHP

<?php
session_start();
// If already logged in, redirect to admin panel
if (isset($_SESSION['admin_logged_in']) && $_SESSION['admin_logged_in'] === true) {
header('Location: admin.php');
exit;
}
// Hardcoded password for simplicity. In a real app, use a secure, hashed password.
$admin_password = 'deep1'; // Same as the premium access code for now
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!empty($_POST['password']) && $_POST['password'] === $admin_password) {
$_SESSION['admin_logged_in'] = true;
header('Location: admin.php');
exit;
} else {
$error = 'Invalid password. Please try again.';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Login - gomoviz.asia</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-card {
width: 100%;
max-width: 400px;
}
</style>
</head>
<body>
<div class="card form-card login-card">
<div class="card-body p-4 p-md-5">
<h2 class="text-center mb-4">Admin Login</h2>
<form method="POST" action="admin_login.php">
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<?php if ($error): ?>
<div class="alert alert-danger"><?php echo $error; ?></div>
<?php endif; ?>
<button type="submit" class="btn btn-primary w-100">Login</button>
</form>
</div>
</div>
</body>
</html>