File Upload not saving file name to database, but saving other fields
Any idea why this isn't saving the file name to database, but is saving the other data?
The form...
<form name="FORMupload" method="POST" action="">
<div class="form-group">
<label for="SMCuploadFILE">Please select a file:</label>
<input type="file" class="form-control-file" id="SMCuploadFILE" name="SMCuploadFILE">
</div>
<button type="submit" class="btn btn-primary mb-2" name="BTNupload">Upload File</button>
<input type="hidden" value="<?php echo $_SESSION['NEWformID']; ?>" name="HIDEformSTEP5ID">
<input type="hidden" value="<?php echo $_SESSION['NEWuserID']; ?>" name="HIDEformUSERID">
</form>
The server behaviours...
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "uploads/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["BTNupload"]) || isset($_POST["BTNupload_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "SMCuploadFILE", "2", "[NewFileName]_[Increment]", "false", $WA_UploadResult1_Params);
}
?>
<?php
if (isset($_POST["BTNupload"]) || isset($_POST["BTNupload_x"])) {
$InsertQuery = new WA_MySQLi_Query($csdbmysqli);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "SMCuploads";
$InsertQuery->bindColumn("SMCformID", "i", "".((isset($_POST["HIDEformSTEP5ID"]))?$_POST["HIDEformSTEP5ID"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserID", "i", "".((isset($_POST["HIDEformUSERID"]))?$_POST["HIDEformUSERID"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuploadFILE", "s", "".$WA_DFP_UploadStatus["WA_UploadResult1"]["WA_UploadResult1_1"]["serverFileName"] ."", "WA_DEFAULT");
$InsertQuery->saveInSession("NEWuploadID");
$InsertQuery->execute();
$InsertGoTo = "health-screening-form.php?tab5=1";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
Thank you.
NJ