File Download
Hi, I am trying to apply two download behaviors in one page but only the first works (WA_DownloadResult1), and if I invert the order of the behaviors the one that will work will be (WA_DownloadResult2) the code is generated like this:
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if(($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)){
WA_DFP_DownloadFile("WA_DownloadResult1", "../files/ringtones/", "".((isset($_POST["name"]))?$_POST["name"]:"") ."", "[FileName]", 1, $database_DatatablesConn, $DatatablesConn, "products", "ProductID", "".((isset($_POST["product"]))?$_POST["product"]:"") ."", "ProductCount");
}
?>
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult2");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_DownloadFile("WA_DownloadResult2", "../files/songs/", "".((isset($_POST["name"]))?$_POST["name"]:"") ."", "[FileName]", 1, $database_DatatablesConn, $DatatablesConn, "products", "ProductID", "".((isset($_POST["product"]))?$_POST["product"]:"") ."", "ProductCount");
}
?>
Thank you in advance.
Note: I am using two tables with two different recordsets, one for the ringtones and other for the songs the forms have different names and the hidden fields and download button have the same names becuause I am also using a DataAssist insert behavior to count in another table (downloads table) the downloads and the ID of the user that downloaded the file