new code
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../prodimages/",
'FileName' => "[FileName]",
'DefaultFileName' => "../prodimages/clear.gif",
'ResizeType' => "2",
'ResizeWidth' => "450",
'ResizeHeight' => "0",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "ProdImage", "3", "[ExistingFileName]_[Increment]", "true", $WA_UploadResult1_Params);
}
?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $wandaWA;
$WA_table = "products";
$WA_sessionName = "WADA_Insert_products";
$WA_redirectURL = "prod_Detail.php";
$WA_keepQueryString = false;
$WA_indexField = "ProdID";
$WA_fieldNamesStr = "ProdName|ProdShortDesc|ProdLongDesc|ProdPrice|ProdSKU|ProdThumb|ProdImage|ProdCatID|ProdWeight|ProdDiscMin|ProdDiscPrice";
$WA_fieldValuesStr = "".((isset($_POST["ProdName"]))?$_POST["ProdName"]:"") ."" . "|" . "".((isset($_POST["ProdShortDesc"]))?$_POST["ProdShortDesc"]:"") ."" . "|" . "".((isset($_POST["ProdLongDesc"]))?$_POST["ProdLongDesc"]:"") ."" . "|" . "".((isset($_POST["ProdPrice"]))?$_POST["ProdPrice"]:"") ."" . "|" . "".((isset($_POST["ProdSKU"]))?$_POST["ProdSKU"]:"") ."" . "|" . "".((isset($_POST["ProdThumb"]))?$_POST["ProdThumb"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["ProdCatID"]))?$_POST["ProdCatID"]:"") ."" . "|" . "".((isset($_POST["ProdWeight"]))?$_POST["ProdWeight"]:"") ."" . "|" . "".((isset($_POST["ProdDiscMin"]))?$_POST["ProdDiscMin"]:"") ."" . "|" . "".((isset($_POST["ProdDiscPrice"]))?$_POST["ProdDiscPrice"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|none,none,NULL|none,none,NULL";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_wandaWA;
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
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/cms_base.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Insert products</title>
<!-- InstanceEndEditable -->
<link href="../wbc/C_M_S/cmsglobal.css" rel="stylesheet" type="text/css" />
<link href="../wbc/Global.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<!-- InstanceBeginEditable name="head" -->
<link href="../WA_DataAssist/styles/Refined_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="../WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
<script src="../WA_DigitalFilePro/jquery-blockui-formprocessing.js" type="text/javascript"></script>
<!-- InstanceEndEditable -->
</head>
<body><div align="center" class="header"><?php include('cmsheader.php'); ?></div>
<table width="600" border="0" align="center" bgcolor="#FFFFFF">
<tr>
<td align="center"><!-- InstanceBeginEditable name="title" -->
<p class="PageName">Title Here </p>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td align="center"><div class="mainAdm" id="cm">
<table width="100%" border="1" cellpadding="5" cellspacing="5" bordercolor="#CCCCCC">
<tr>
<td align="center">
<!-- InstanceBeginEditable name="maincont" -->
<p> </p>
<div class="WADAInsertContainer">
<div id="WADAInsertForm_ProgressWrapper">
<form action="prod_Insert.php" method="post" enctype="multipart/form-data" name="WADAInsertForm" id="WADAInsertForm">
<div class="WADAHeader">Insert Record</div>
<div class="WADAHorizLine"><img src="../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">Name:</th>
<td class="WADADataTableCell"><input type="text" name="ProdName" id="ProdName" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ShortDesc:</th>
<td class="WADADataTableCell"><textarea name="ProdShortDesc" id="ProdShortDesc" cols="32"></textarea></td>
</tr>
<tr>
<th class="WADADataTableHeader">LongDesc:</th>
<td class="WADADataTableCell"><textarea name="ProdLongDesc" id="ProdLongDesc" cols="32"></textarea></td>
</tr>
<tr>
<th class="WADADataTableHeader">Price:</th>
<td class="WADADataTableCell"><input type="text" name="ProdPrice" id="ProdPrice" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdSKU:</th>
<td class="WADADataTableCell"><input type="text" name="ProdSKU" id="ProdSKU" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdThumb:</th>
<td class="WADADataTableCell"><input type="text" name="ProdThumb" id="ProdThumb" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdImage:</th>
<td class="WADADataTableCell" id="ProdImage"><input type="file" name="ProdImage" id="ProdImage" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdCatID:</th>
<td class="WADADataTableCell"><select name="ProdCatID" id="ProdCatID">
<option value="">cats</option>
<?php
do {
?>
<option value="<?php echo $row_WADADynListprodcategory['CatID']?>"><?php echo $row_WADADynListprodcategory['CatName']?></option>
<?php
} while ($row_WADADynListprodcategory = mysql_fetch_assoc($WADADynListprodcategory));
$rows = mysql_num_rows($WADADynListprodcategory);
if($rows > 0) {
mysql_data_seek($WADADynListprodcategory, 0);
$row_WADADynListprodcategory = mysql_fetch_assoc($WADADynListprodcategory);
}
?>