Redirect after file download
I want to redirect the user to another page after a pdf is presented for download, this is my code:
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if(isset($_POST["downloadPDF"])){
WA_DFP_DownloadFile("WA_DownloadResult1", "pdf/", "".((isset($_POST["aspect"]))?$_POST["aspect"]:"") . ((isset($_POST["needed"]))?$_POST["needed"]:"") . ((isset($_POST["arrow"]))?$_POST["arrow"]:"") . '_' . ((isset($_POST["problem"]))?$_POST["problem"]:"") . '_' . ((isset($_POST["message"]))?$_POST["message"]:"") . '.pdf' ."", "[FileName]", false, false, false, "", "", "", "");
}
?>
<?php
if(isset($_POST["downloadPDF"])){
$WA_Redirect_URL = "dynamic-sign-generator.php";
$WA_Redirect_KeepQS = false;
if ($WA_Redirect_URL != "") {
if ($WA_Redirect_KeepQS && $WA_Redirect_URL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "") {
$WA_Redirect_URL .= ((strpos($WA_Redirect_URL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_Redirect_URL);
}
}
?>
but the redirect call has no effect, how can I make this happen please ?