
<?php
$name=trim((string)($_POST['name'] ?? '')); $song=trim((string)($_POST['song'] ?? '')); $artist=trim((string)($_POST['artist'] ?? '')); $message=trim((string)($_POST['message'] ?? '')); $ded=trim((string)($_POST['dedication'] ?? ''));
if($name!=='' && ($song!=='' || $artist!=='')){
  $line = implode('|',[uniqid(),str_replace('|','/',$name),str_replace('|','/',$song),str_replace('|','/',$artist),str_replace('|','/',$message),str_replace('|','/',$ded),date('Y-m-d H:i:s')]) . PHP_EOL;
  file_put_contents(__DIR__ . '/data/requests.txt', $line, FILE_APPEND);
}
header('Location: /requests.php?sent=1'); exit;
