MINI
C:
/
xampp
/
htdocs
/
reset
/
Upload File:
files >> C:/xampp/htdocs/reset/login.php
<?php require_once 'config.php'; ?> <?php if (isLoggedIn()) { redirect('index.php'); } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $username = $_POST['username'] ?? ''; $password = $_POST['password'] ?? ''; if (login($username, $password)) { $_SESSION['success'] = "Login berhasil!"; redirect('index.php'); } else { $error = "Username atau password salah"; } } ?> <!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Login - Manajemen Kartu</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css"> <style> body { background-color: #f8f9fc; display: flex; justify-content: center; align-items: center; height: 100vh; } .login-container { width: 400px; padding: 2rem; background: white; border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.1); } .logo { text-align: center; margin-bottom: 2rem; } .logo i { font-size: 4rem; color: #4e73df; } </style> </head> <body> <div class="login-container"> <div class="logo"> <i class="bi bi-shield-lock"></i> <h2>Koperasi XYZ</h2> <p>Manajemen Kartu Anggota</p> </div> <?php if (isset($_SESSION['error'])): ?> <div class="alert alert-danger"><?= $_SESSION['error'] ?></div> <?php unset($_SESSION['error']); ?> <?php endif; ?> <?php if (isset($error)): ?> <div class="alert alert-danger"><?= $error ?></div> <?php endif; ?> <?php if (isset($_SESSION['success'])): ?> <div class="alert alert-success"><?= $_SESSION['success'] ?></div> <?php unset($_SESSION['success']); ?> <?php endif; ?> <form method="post"> <div class="mb-3"> <label for="username" class="form-label">Username</label> <input type="text" class="form-control" id="username" name="username" required> </div> <div class="mb-3"> <label for="password" class="form-label">Password</label> <input type="password" class="form-control" id="password" name="password" required> </div> <button type="submit" class="btn btn-primary w-100"> <i class="bi bi-box-arrow-in-right"></i> Login </button> </form> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
Copyright ©2021 || Defacer Indonesia