<?php
// Collect form data
$name = $_POST['name'] ?? '';
$email = $_POST['email'] ?? '';
$song = $_POST['song'] ?? '';
$artist = $_POST['artist'] ?? '';
$dedication = $_POST['dedication'] ?? '';

// Save request to file
$saveFile = __DIR__ . '/data/requests.txt';
$entry = "Name: $name\nEmail: $email\nSong: $song\nArtist: $artist\nDedication: $dedication\n---\n";
file_put_contents($saveFile, $entry, FILE_APPEND);

// Redirect back with success message
header("Location: requests.php?sent=1");
exit;
