-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthenticate.php
More file actions
68 lines (61 loc) · 3.18 KB
/
Copy pathauthenticate.php
File metadata and controls
68 lines (61 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
session_start();
// Sticky form logic: retrieve the email if the last login attempt failed
$sticky_email = isset($_SESSION['sticky_email']) ? $_SESSION['sticky_email'] : "";
$login_err = isset($_SESSION['login_error']) ? $_SESSION['login_error'] : "";
// Clear them so they don't persist after a refresh
unset($_SESSION['login_error']);
unset($_SESSION['sticky_email']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Styles remain the same -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign In | Pastimes®</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
:root { --studio-blue: #0678eb; }
body { font-family: 'Inter', sans-serif; background-color: #fff; height: 100vh; display: flex; align-items: center; }
.auth-card { max-width: 450px; margin: auto; padding: 40px; border: 1px solid #eee; }
.navbar-brand { font-weight: 800; font-size: 24px; color: #000 !important; letter-spacing: 1px; text-transform: uppercase; display: block; text-align: center; margin-bottom: 30px; text-decoration: none; }
.form-label { font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
.form-control { border-radius: 0; border: 1px solid #ddd; padding: 12px; }
.btn-auth { background: var(--studio-blue); color: #fff; border: none; padding: 15px; width: 100%; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; }
.auth-footer { font-size: 13px; text-align: center; margin-top: 20px; }
.auth-footer a { color: var(--studio-blue); font-weight: 700; text-decoration: none; }
</style>
</head>
<body>
<div class="container">
<div class="auth-card">
<a class="navbar-brand" href="index.php">Pastimes®</a>
<h5 class="text-center fw-black text-uppercase mb-4">Welcome Back</h5>
<!-- Sticky Form Error Feedback -->
<?php if($login_err): ?>
<div class="alert alert-danger small fw-bold text-center">
<i class="fa-solid fa-circle-exclamation me-2"></i> <?php echo $login_err; ?>
</div>
<?php endif; ?>
<form action="login_logic.php" method="POST">
<div class="mb-3">
<label class="form-label">Email Address or Username</label>
<!-- This input is now 'sticky' using the $sticky_email variable -->
<input type="text" name="identifier" class="form-control"
value="<?php echo htmlspecialchars($sticky_email); ?>"
placeholder="e.g. customer@example.com" required>
</div>
<div class="mb-3">
<label class="form-label">Password</label>
<input type="password" name="password" class="form-control" required>
</div>
<button type="submit" name="login_btn" class="btn-auth">Sign In</button>
</form>
<div class="auth-footer">
New to Pastimes? <a href="sign-up.php">Join Now</a>
</div>
</div>
</div>
</body>
</html>