ÿØÿà JFIFÿØÿà JFIF ÿØÿà JFIFÿØÿà JFIF ÿþ$
<?php
session_start();
include 'config.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = trim($_POST['username']);
$password = $_POST['pass'];
// Prepared statement (prevents SQL injection)
$stmt = $conn->prepare("SELECT id, username, password FROM admin_users WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows === 1) {
$admin = $result->fetch_assoc();
// Verify password
if (password_verify($password, $admin['password'])) {
// Create session
$_SESSION['admin_logged_in'] = true;
$_SESSION['admin_id'] = $admin['id'];
$_SESSION['admin_username'] = $admin['username'];
header("Location: admin_real_change.php");
exit;
} else {
$error = "Invalid username or password.";
}
} else {
$error = "Invalid username or password.";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link rel="stylesheet" href="css/css/materialize.css">
<title>Admin – The GLitz Contest</title>
</head>
<style>
body, html { height: 100%; }
.bg {
background: linear-gradient(to right, #886018, #886018, #F8D868);
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.gh {
background-color: #886018;
border-radius: 10px;
}
.confirm {
border:2px solid #886018;
border-radius: 10px;
margin-top: 50px;
}
label { color:#886018; font-weight:bold; }
</style>
<body class="bg">
<br><br><br>
<div class="container">
<h4 class="center white-text">Please Login to Continue</h4>
<?php if (!empty($error)): ?>
<div class="card-panel red white-text center"><?= htmlspecialchars($error) ?></div>
<?php endif; ?>
<div class="row">
<div class="col l4"></div>
<div class="confirm col l4 z-depth-5" style="background-color: white">
<form action="" method="POST">
<label>Username
<input type="text" name="username" required>
</label>
<label>Password
<input type="password" name="pass" required>
</label>
<div class="center">
<button type="submit" class="btn gh">Login</button>
</div>
<br>
</form>
</div>
<div class="col l4"></div>
</div>
</div>
</body>
</html>
ÿØÿà JFIF ÿþ$
ÿØÿà JFIF ÿþ$
ÿÂ