
<?php
$name=trim((string)($_POST['name'] ?? '')); $email=trim((string)($_POST['email'] ?? '')); $role=trim((string)($_POST['role'] ?? '')); $experience=trim((string)($_POST['experience'] ?? '')); $why=trim((string)($_POST['why'] ?? ''));
$demo=''; if (!empty($_FILES['demo']) && ($_FILES['demo']['error'] ?? UPLOAD_ERR_NO_FILE) === UPLOAD_ERR_OK) { $ext = strtolower(pathinfo($_FILES['demo']['name'], PATHINFO_EXTENSION)); if (in_array($ext, ['mp3','wav','ogg','m4a'], true)) { $dir = __DIR__ . '/uploads/demos'; if (!is_dir($dir)) @mkdir($dir, 0777, true); $demo = 'demo_' . uniqid() . '.' . $ext; move_uploaded_file($_FILES['demo']['tmp_name'], $dir . '/' . $demo); } }
if($name!=='' && $email!==''){ $line = implode('|',[uniqid(),str_replace('|','/',$name),str_replace('|','/',$email),'',str_replace('|','/',$why),'',str_replace('|','/',$role),str_replace('|','/',$experience),'', '', $demo, date('Y-m-d H:i:s')]) . PHP_EOL; file_put_contents(__DIR__ . '/data/applications.txt', $line, FILE_APPEND); }
header('Location: /team.php?sent=1'); exit;
