Trouble combining Data Assist Insert Record & Digital File Pro
Hi,
I am having trouble combining these two functionalities.
I can use Data Assist Insert Record to upload text to my database no worries.
I can upload files to my server using DFP no worries.
If I have both on the same page and want to send the filename to a field in my database the image doesn't upload and the filename isn't sent to the database.
I have seen the forum posts and tutorial where it says to get the Server Filename variable for Data Assist - but which ever variable I select, none seem to work.
Is there a trick to this??
This is the code:
Thanks for any help in advance.
<?php require_once('../../Connections/connTest.php'); ?>
<?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/user/thumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "85",
'ResizeHeight' => "85",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "thumbUpload", "0", "", "JPG:80", $WA_UploadResult1_Params);
}
?>
<?php
require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php require_once( "../WA_Globals/WA_Globals.php" ); ?>
<?php require_once( "../WA_CMS/WA_CMS.php" ); ?>
<?php require_once('../Connections/localhost.php'); ?>
<?php require_once("../../HTMLEditor/WARichEditorPHP.php"); ?>
<?php
// WA Application Builder Insert
if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger
{
$WA_connection = $connTest;
$WA_table = "content";
$WA_sessionName = "contentID";
$WA_redirectURL = "newsDetail.php";
$WA_keepQueryString = false;
$WA_indexField = "contentID";
$WA_fieldNamesStr = "contentTitle|thumbImg|contentHome|contentLong|contentShort|date";
$WA_fieldValuesStr = "".((isset($_POST["contentTitle"]))?$_POST["contentTitle"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["contentHome"]))?$_POST["contentHome"]:"") ."" . "|" . "".((isset($_POST["contentLong"]))?$_POST["contentLong"]:"") ."" . "|" . "".((isset($_POST["contentShort"]))?$_POST["contentShort"]:"") ."" . "|" . "".((isset($_POST["contentDate"]))?$_POST["contentDate"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_connPriefert;
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);
}
}
?>
<?php
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../images/user/thumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "85",
'ResizeHeight' => "85",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
?>