Thanks!
Now the file is loaded in the folder with the right name, but the page gives me the following error:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\xampp\htdocs\new-junior-team\admin\automobili_Inserisci.php:81) in C:\Program Files\xampp\htdocs\new-junior-team\admin\automobili_Inserisci.php on line 99
and the db is not updated.
This is the code:
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $newjuniorteam;
$WA_table = "automobili";
$WA_sessionName = "WADA_Insert_automobili";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "id_automobile";
$WA_fieldNamesStr = "id_marca|id_stato|nome|descrizione|prezzo|foto1|foto2|foto3|attivo";
$WA_fieldValuesStr = "".((isset($_POST["id_marca"]))?$_POST["id_marca"]:"") ."" . "|" . "".((isset($_POST["id_stato"]))?$_POST["id_stato"]:"") ."" . "|" . "".((isset($_POST["nome"]))?$_POST["nome"]:"") ."" . "|" . "".((isset($_POST["descrizione"]))?$_POST["descrizione"]:"") ."" . "|" . "".((isset($_POST["prezzo"]))?$_POST["prezzo"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["foto2"]))?$_POST["foto2"]:"") ."" . "|" . "".((isset($_POST["foto3"]))?$_POST["foto3"]:"") ."" . "|" . "".((isset($_POST["attivo"]))?$_POST["attivo"]:"") ."";
$WA_columnTypesStr = "none,none,NULL|none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,0";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_newjuniorteam;
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 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../upload/",
'FileName' => "".$_SESSION['WADA_Insert_automobili'] ."",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "foto1", "0", "", "false", $WA_UploadResult1_Params);
}
?>
Thanks for the help!
Diego