-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.php
More file actions
253 lines (216 loc) · 12.1 KB
/
contact.php
File metadata and controls
253 lines (216 loc) · 12.1 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<?php
/**
* RetroGate — Contact Page
* A guestbook AND a contact form. Because it's 1997 and we can have both.
*/
$page_title = 'Contact';
$page_description = 'Get in touch with the RetroGate team. Bug reports, feature requests, love letters from vintage Macs — we read them all.';
$form_submitted = false;
$form_errors = [];
$form_data = [
'name' => '',
'email' => '',
'vintage_machine' => '',
'subject' => '',
'message' => '',
'favorite_os' => '',
];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$form_data = [
'name' => trim($_POST['name'] ?? ''),
'email' => trim($_POST['email'] ?? ''),
'vintage_machine' => trim($_POST['vintage_machine'] ?? ''),
'subject' => trim($_POST['subject'] ?? ''),
'message' => trim($_POST['message'] ?? ''),
'favorite_os' => trim($_POST['favorite_os'] ?? ''),
];
// Validation
if (empty($form_data['name'])) {
$form_errors[] = 'Please enter your name (or your Mac\'s name — we don\'t judge).';
}
if (empty($form_data['email']) || !filter_var($form_data['email'], FILTER_VALIDATE_EMAIL)) {
$form_errors[] = 'Please enter a valid email address. AOL addresses are welcome.';
}
if (empty($form_data['message'])) {
$form_errors[] = 'Please enter a message. Even "bong" counts.';
}
// Honeypot check
if (!empty($_POST['website_url'])) {
// Bot detected — silently "succeed"
$form_submitted = true;
}
if (empty($form_errors) && !$form_submitted) {
$to = 'hello@retrogate.app';
$subject_prefix = match($form_data['subject']) {
'bug' => '[Bug]',
'feature' => '[Feature]',
'help' => '[Help]',
'love' => '[Fan Mail]',
'vintage' => '[Vintage Story]',
default => '[Contact]',
};
$mail_subject = "$subject_prefix Message from {$form_data['name']}";
$body = "Name: {$form_data['name']}\n";
$body .= "Email: {$form_data['email']}\n";
$body .= "Vintage Machine: " . ($form_data['vintage_machine'] ?: 'Not specified') . "\n";
$body .= "Favorite OS: " . ($form_data['favorite_os'] ?: 'Not specified') . "\n";
$body .= "Subject: " . ($form_data['subject'] ?: 'Not specified') . "\n";
$body .= "\n---\n\n";
$body .= $form_data['message'];
$headers = "From: noreply@retrogate.app\r\n";
$headers .= "Reply-To: {$form_data['email']}\r\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\r\n";
$headers .= "X-Mailer: RetroGate-Website/1.0";
$form_submitted = mail($to, $mail_subject, $body, $headers);
if (!$form_submitted) {
$form_errors[] = 'Failed to send message. Please try again or email us directly at hello@retrogate.app.';
}
}
}
require_once __DIR__ . '/includes/header.php';
?>
<section class="page-header">
<h1>Contact Us</h1>
<p class="subtitle">Bug reports, feature requests, and love letters from vintage Macs.</p>
</section>
<div class="contact-content">
<?php if ($form_submitted): ?>
<!-- Success State -->
<div style="text-align: center; padding: 3rem 0;">
<h2>Message Sent!</h2>
<p style="margin: 1rem auto; max-width: 500px;">
Your message has been transmitted via HTTP/1.0 to our inbox.
We’ll read it on a genuine PowerBook 520 for maximum authenticity.
</p>
<p style="color: #888; font-family: var(--font-pixel);">
Estimated response time: faster than a 14.4k modem, slower than a T1 line.
</p>
<a href="/" class="btn btn-on-light" style="margin-top: 2rem;">← Back to Home</a>
</div>
<?php else: ?>
<p style="margin-bottom: 2rem;">
Found a bug? Have a feature request? Want to tell us about the time your Performa 6400
survived a lightning strike? We’d love to hear from you.
</p>
<?php if (!empty($form_errors)): ?>
<div style="background: #fff0f0; border: 2px solid #cc0000; padding: 1rem 1.5rem; margin-bottom: 1.5rem; font-family: var(--font-pixel);">
<strong style="color: #cc0000;">⚠ ERROR 418: I'm a teapot</strong>
<p style="color: #cc0000; margin: 0.5rem 0 0;">Just kidding. But there were some issues:</p>
<ul style="margin: 0.5rem 0 0 1.5rem; color: #cc0000;">
<?php foreach ($form_errors as $error): ?>
<li><?= htmlspecialchars($error) ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<div class="retro-form">
<div style="font-family: var(--font-pixel); color: var(--amber-dark); margin-bottom: 1.5rem; font-size: 1.1rem;">
COMPOSE NEW MESSAGE
</div>
<form method="POST" action="/contact.php">
<!-- Honeypot field — hidden from humans, visible to bots -->
<div style="position: absolute; left: -9999px;" aria-hidden="true">
<label for="website_url">Leave this empty</label>
<input type="text" name="website_url" id="website_url" tabindex="-1" autocomplete="off">
</div>
<div class="form-group">
<label for="name">Your Name *</label>
<input type="text" id="name" name="name" placeholder="e.g., Steve, or 'Macintosh LC 475'"
value="<?= htmlspecialchars($form_data['name']) ?>" required>
<div class="field-hint">Human names and Mac model numbers both accepted.</div>
</div>
<div class="form-group">
<label for="email">Email Address *</label>
<input type="email" id="email" name="email" placeholder="you@aol.com"
value="<?= htmlspecialchars($form_data['email']) ?>" required>
<div class="field-hint">We promise not to sell this to any dot-com startups. It's not 1999 anymore. Wait...</div>
</div>
<div class="form-group">
<label for="vintage_machine">Your Vintage Machine</label>
<input type="text" id="vintage_machine" name="vintage_machine"
placeholder="e.g., Power Macintosh 7200, Quadra 605, SheepShaver on M2"
value="<?= htmlspecialchars($form_data['vintage_machine']) ?>">
<div class="field-hint">Optional, but it helps us cry happy tears.</div>
</div>
<div class="form-group">
<label for="favorite_os">Favorite Vintage OS</label>
<select id="favorite_os" name="favorite_os">
<option value="" <?= $form_data['favorite_os'] === '' ? 'selected' : '' ?>>-- Choose wisely --</option>
<option value="system6" <?= $form_data['favorite_os'] === 'system6' ? 'selected' : '' ?>>System 6 (the purist's choice)</option>
<option value="system7" <?= $form_data['favorite_os'] === 'system7' ? 'selected' : '' ?>>System 7 (the golden age)</option>
<option value="macos8" <?= $form_data['favorite_os'] === 'macos8' ? 'selected' : '' ?>>Mac OS 8 (the Platinum era)</option>
<option value="macos9" <?= $form_data['favorite_os'] === 'macos9' ? 'selected' : '' ?>>Mac OS 9 (the GOAT, fight me)</option>
<option value="macosx" <?= $form_data['favorite_os'] === 'macosx' ? 'selected' : '' ?>>Mac OS X (Aqua baby!)</option>
<option value="win31" <?= $form_data['favorite_os'] === 'win31' ? 'selected' : '' ?>>Windows 3.1 (bravery)</option>
<option value="win95" <?= $form_data['favorite_os'] === 'win95' ? 'selected' : '' ?>>Windows 95 (Start me up!)</option>
<option value="win98" <?= $form_data['favorite_os'] === 'win98' ? 'selected' : '' ?>>Windows 98 (peak Windows)</option>
<option value="other" <?= $form_data['favorite_os'] === 'other' ? 'selected' : '' ?>>Other (please specify in message)</option>
<option value="all" <?= $form_data['favorite_os'] === 'all' ? 'selected' : '' ?>>I love them all equally (liar)</option>
</select>
</div>
<div class="form-group">
<label for="subject">Subject</label>
<select id="subject" name="subject">
<option value="" <?= $form_data['subject'] === '' ? 'selected' : '' ?>>-- Select --</option>
<option value="bug" <?= $form_data['subject'] === 'bug' ? 'selected' : '' ?>>Bug Report</option>
<option value="feature" <?= $form_data['subject'] === 'feature' ? 'selected' : '' ?>>Feature Request</option>
<option value="help" <?= $form_data['subject'] === 'help' ? 'selected' : '' ?>>Help / Support</option>
<option value="love" <?= $form_data['subject'] === 'love' ? 'selected' : '' ?>>Fan Mail / Love Letter</option>
<option value="vintage" <?= $form_data['subject'] === 'vintage' ? 'selected' : '' ?>>Vintage Mac Story</option>
<option value="other" <?= $form_data['subject'] === 'other' ? 'selected' : '' ?>>Other</option>
</select>
</div>
<div class="form-group">
<label for="message">Message *</label>
<textarea id="message" name="message" placeholder="Tell us everything. We have time. Our proxy server handles the requests while we read."
required><?= htmlspecialchars($form_data['message']) ?></textarea>
<div class="field-hint">Pro tip: including your Mac's startup chime sound ("bong!") counts as a valid message.</div>
</div>
<div style="margin-top: 2rem;">
<button type="submit" class="btn btn-primary" style="border: 3px solid var(--amber); cursor: pointer; font-family: var(--font-pixel);">
SEND MESSAGE
</button>
</div>
<p style="margin-top: 1.5rem; font-size: 0.8rem; color: #999; font-family: var(--font-pixel);">
This form is served over HTTP because we practice what we preach.
Your data is handled with the same care we give to a Macintosh SE — gently and with great reverence.
</p>
</form>
</div>
<?php endif; ?>
<!-- Guestbook Section -->
<div style="margin-top: 4rem;">
<h2 style="text-align: center; margin-bottom: 0.5rem;">The Guestbook</h2>
<p style="text-align: center; font-style: italic; color: var(--brown-light); margin-bottom: 2rem;">
Because no self-respecting 90s website is complete without one.
</p>
<div class="guestbook-entries">
<div class="guestbook-entry">
<span class="entry-name">PowerBook_G3_Lombard</span>
<span class="entry-date"> — March 15, 2025</span>
<p class="entry-text">Finally, someone who understands that I’m not obsolete — I’m <em>vintage</em>. RetroGate let me browse Wikipedia for the first time in 20 years. I cried. My trackpad got wet. Worth it.</p>
</div>
<div class="guestbook-entry">
<span class="entry-name">iMac_G3_Bondi</span>
<span class="entry-date"> — March 8, 2025</span>
<p class="entry-text">HELLO YES I AM BACK ON THE INTERNET. IT HAS BEEN 23 YEARS. WHY IS EVERYTHING SO... FLAT? WHERE ARE THE BEVELS? WHERE ARE THE DROP SHADOWS? Anyway, RetroGate is great, 5 stars.</p>
</div>
<div class="guestbook-entry">
<span class="entry-name">Quadra_950_Server</span>
<span class="entry-date"> — February 28, 2025</span>
<p class="entry-text">I have been running continuously since 1993. I have never been restarted. I have seen the rise and fall of Netscape, the birth of Google, and the death of GeoCities. RetroGate is the first new software I’ve been excited about in 30 years.</p>
</div>
<div class="guestbook-entry">
<span class="entry-name">anonymous_486dx2</span>
<span class="entry-date"> — February 20, 2025</span>
<p class="entry-text">I’m a PC and I’m using RetroGate. Yes, there are PC presets. No, I’m not ashamed. Windows 95 was a great operating system and I will die on this hill. The Start button was revolutionary.</p>
</div>
<div class="guestbook-entry">
<span class="entry-name">SheepShaver_User_42</span>
<span class="entry-date"> — February 14, 2025</span>
<p class="entry-text">Step 1: Configure proxy. Step 2: Browse. Step 3: Network drops. Step 4: Restart SheepShaver. Step 5: Goto Step 1. It’s a feature, not a bug. Happy Valentine’s Day to my favorite temperamental VM.</p>
</div>
</div>
</div>
</div>
<?php require_once __DIR__ . '/includes/footer.php'; ?>