images upload but filename not moving into db
having an issue. always worked in the past with v1, but in v2, now getting an issue where all the form fields are carried into the db, except for the file names. I have used the WA behaviors to set the server file name but they are not being carried into the DB
the link to the test page for this function is:
itemimages_Insert.php?ItemID=12
have i missed something?
code on top of page is:
<?php require_once("../Connections/mayther.php"); ?>
<?php
$ItemID = $_GET[ItemID];
?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "images/thumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "100",
'ResizeHeight' => "100",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "images/imagesmedium/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "300",
'ResizeHeight' => "300",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_2 End
// WA_UploadResult1_3 Start
$WA_UploadResult1_Params["WA_UploadResult1_3"] = array(
'UploadFolder' => "images/largeimages/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "629",
'ResizeHeight' => "473",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_3 End
// WA_UploadResult1_4 Start
$WA_UploadResult1_Params["WA_UploadResult1_4"] = array(
'UploadFolder' => "images/originalitems/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "800",
'ResizeHeight' => "600",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_4 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "FileName", "2", "[NewFileName]_[Increment]", "JPG:80", $WA_UploadResult1_Params);
}
?>
<?php
$itemid = $_GET[ItemID]; ?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $mayther;
$WA_table = "itemimages";
$WA_sessionName = "WADA_Insert_itemimages";
$WA_redirectURL = "itemimages_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "imageID";
$WA_fieldNamesStr = "ItemID|imagesmall|imagemed|imagelarge|imagedescription";
$WA_fieldValuesStr = "".((isset($_POST["ItemID"]))?$_POST["ItemID"]:"") ."" . "|" . "".((isset($_POST["imagesmall"]))?$_POST["imagesmall"]:"") ."" . "|" . "".((isset($_POST["imagemed"]))?$_POST["imagemed"]:"") ."" . "|" . "".((isset($_POST["imagelarge"]))?$_POST["imagelarge"]:"") ."" . "|" . "".((isset($_POST["imagedescription"]))?$_POST["imagedescription"]:"") ."";
$WA_columnTypesStr = "none,none,NULL|',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_mayther;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>