<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Contact Form - PAGI::Request Demo</title>
<style>
body { font-family: sans-serif; max-width: 600px; margin: 2em auto; padding: 0 1em; }
label { display: block; margin-top: 1em; font-weight: bold; }
input, textarea, select { width: 100%; padding: 0.5em; margin-top: 0.25em; }
input[type="file"] { padding: 0.25em 0; }
button { margin-top: 1.5em; padding: 0.75em 2em; background: #007bff; color: white; border: none; cursor: pointer; }
button:hover { background: #0056b3; }
.error { color: #dc3545; background: #f8d7da; padding: 0.75em; margin-top: 1em; border-radius: 4px; }
.success { color: #155724; background: #d4edda; padding: 0.75em; margin-top: 1em; border-radius: 4px; }
.info { color: #666; font-size: 0.9em; margin-top: 0.25em; }
</style>
</head>
<body>
<h1>Contact Form</h1>
<p>This example demonstrates PAGI::Request with form handling and file uploads.</p>
<form method="POST" action="/submit" enctype="multipart/form-data">
<label for="name">Name *</label>
<input type="text" id="name" name="name" required>
<label for="email">Email *</label>
<input type="email" id="email" name="email" required>
<label for="subject">Subject</label>
<select id="subject" name="subject">
<option value="general">General Inquiry</option>
<option value="support">Technical Support</option>
<option value="feedback">Feedback</option>
</select>
<label for="message">Message *</label>
<textarea id="message" name="message" rows="5" required></textarea>
<label for="attachment">Attachment (optional)</label>
<input type="file" id="attachment" name="attachment">
<p class="info">Max 5MB. Allowed: PDF, images, text files.</p>
<label>
<input type="checkbox" name="subscribe" value="yes">
Subscribe to newsletter
</label>
<button type="submit">Send Message</button>
</form>
</body>
</html>