| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/vhost/book.gyaniguru.org/admin/ |
Upload File : |
<?php
session_start();
require_once '../includes/db.php';
$error = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$username = $_POST['username'] ?? '';
$password = $_POST['password'] ?? '';
$admin = get_row("SELECT * FROM admins WHERE username = ?", [$username]);
if ($admin && password_verify($password, $admin['password'])) {
$_SESSION['admin_id'] = $admin['id'];
$_SESSION['admin_name'] = $admin['name'];
header("Location: index.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 | GyaniGuru by JMC</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
<link rel="stylesheet" href="../css/style.css">
<style>
body {
background: var(--cream);
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
margin: 0;
}
.login-card {
background: #fff;
border: 1px solid var(--cream-dark);
border-radius: 20px;
padding: 40px;
width: 100%;
max-width: 400px;
box-shadow: 0 10px 40px rgba(44, 24, 16, 0.1);
}
.login-header {
text-align: center;
margin-bottom: 30px;
}
.login-header h2 {
color: var(--gerua-dark);
font-family: 'Inter', sans-serif; font-weight: 800;
margin-top: 15px;
}
.form-label {
color: var(--text-medium);
font-size: 0.9rem;
font-weight: 500;
}
.form-control {
background: var(--warm-white);
border: 1px solid var(--cream-dark);
color: var(--text-dark);
padding: 12px;
}
.form-control:focus {
background: #fff;
border-color: var(--gerua);
box-shadow: 0 0 0 0.25rem rgba(210, 105, 30, 0.15);
color: var(--text-dark);
}
.btn-gold {
background: var(--gradient-saffron);
border: none;
color: var(--dark-bg);
font-weight: 700;
padding: 12px;
width: 100%;
border-radius: 10px;
margin-top: 20px;
letter-spacing: 0.5px;
}
.btn-gold:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(212,175,55,0.4);
}
.form-control::placeholder {
color: var(--text-light);
}
</style>
</head>
<body>
<div class="login-card">
<div class="login-header">
<div style="margin: 0 auto; width: 60px; height: 60px;">
<img src="../images/logo/logo.png" alt="GyaniGuru" style="width:100%;height:100%;object-fit:contain">
</div>
<h2>Admin Portal</h2>
<p class="text-muted small">GyaniGuru by JMC Management System</p>
</div>
<?php if($error): ?>
<div class="alert alert-danger py-2" style="font-size: 0.85rem;">
<i class="bi bi-exclamation-triangle me-2"></i> <?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" placeholder="Enter username" required>
</div>
<div class="mb-4">
<label class="form-label">Password</label>
<input type="password" name="password" class="form-control" placeholder="Enter password" required>
</div>
<button type="submit" class="btn-gold">LOGIN TO DASHBOARD</button>
</form>
<div class="text-center mt-4">
<a href="../index.php" class="text-decoration-none" style="color: var(--gerua-light); font-size: 0.85rem;">
<i class="bi bi-arrow-left"></i> Back to Website
</a>
</div>
</div>
</body>
</html>