File manager - Edit - /home/webapp69.cm.in.th/u69319090048/shop69319090048/admin/login.php
Back
<?php // admin/login.php - Demo-grade admin login if (session_status() === PHP_SESSION_NONE) { session_start(); } require_once 'config.php'; $error = ''; $action = isset($_GET['action']) ? $_GET['action'] : ''; if ($action === 'logout') { $_SESSION['admin_logged_in'] = false; unset($_SESSION['admin_logged_in']); header('Location: login.php'); exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $username = isset($_POST['username']) ? $_POST['username'] : ''; $password = isset($_POST['password']) ? $_POST['password'] : ''; if ($username === ADMIN_USER && $password === ADMIN_PASS) { $_SESSION['admin_logged_in'] = true; header('Location: index.php'); exit; } else { $error = 'Invalid credentials. Use demo default (admin / admin123).'; } } require_once 'header.php'; ?> <div class="container"> <div class="card-glass login-container"> <h2 style="font-size: 20px; font-weight: 600; margin-bottom: 8px;">Admin Access</h2> <p style="font-size: 13px; color: var(--text-secondary); margin-bottom: 24px;">Use demo credentials: <strong>admin</strong> / <strong>admin123</strong></p> <?php if ($error): ?> <div style="padding: 10px; background-color: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.2); border-radius: 6px; font-size: 12px; margin-bottom: 16px; color: #ff3b30;"> <?php echo htmlspecialchars($error); ?> </div> <?php endif; ?> <form action="login.php" method="POST"> <div class="form-group"> <label for="username">Username</label> <input type="text" id="username" name="username" class="form-control" placeholder="admin" required> </div> <div class="form-group"> <label for="password">Password</label> <input type="password" id="password" name="password" class="form-control" placeholder="••••••••" required> </div> <button type="submit" class="btn btn-primary" style="width: 100%; margin-top: 8px; padding: 12px;">Log In</button> </form> </div> </div> <?php require_once 'footer.php'; ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings