🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:login.php
<?php require_once '../includes/db.php'; if (isset($_POST['login'])) { $username = $_POST['username']; $password = $_POST['password']; $admin = fetchOne("SELECT * FROM admin WHERE username = ?", [$username]); if ($admin && password_verify($password, $admin['password'])) { $_SESSION['admin_id'] = $admin['id']; $_SESSION['admin_username'] = $admin['username']; header("Location: dashboard.php"); exit; } else { $error = "Invalid username or password!"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Admin Login | jobly.lk</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background-color: #002e5b; height: 100vh; display: flex; align-items: center; justify-content: center; } .login-card { width: 400px; border-radius: 15px; } </style> </head> <body> <div class="card login-card shadow-lg"> <div class="card-body p-5"> <h3 class="text-center fw-bold mb-4">Admin Login</h3> <?php if(isset($error)): ?> <div class="alert alert-danger small"><?php echo $error; ?></div> <?php endif; ?> <form action="" method="POST"> <div class="mb-3"> <label class="form-label">Username</label> <input type="text" name="username" class="form-control" required> </div> <div class="mb-4"> <label class="form-label">Password</label> <input type="password" name="password" class="form-control" required> </div> <button type="submit" name="login" class="btn btn-primary w-100 py-2">Sign In</button> </form> <div class="text-center mt-3"> <a href="<?php echo BASE_URL; ?>index.php" class="text-muted small">Back to Website</a> </div> </div> </div> </body> </html>
Save Changes
Cancel
Create New File
Create New Folder