Problem of losing image with update
I've been using the insert/update tutorial to get images to upload on the insert page using DFP and then following the instructions for the update page. Insert works great but i'm losing my images on the update page. I've looked through the forum and i've seen that several other people have struggled with this. Anyway, i understand the concept, i've changed the relevant field to hidden and i've clicked on the lightning thunderbolt next to the default file and added the thumb1 field but it still isn't forwarding the image name onto my update page and so i'm losing the image. I assume my code is wrong somewhere, can someone have a quick look for me and see if they can spot any obvious errors. Thanks.
There are 4 image fields ItemThumb1, Thumb2, Thumb3, Thumb4. There was a fifth called ItemImage but i removed this to try to make things simpler.
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../profilethumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_FILES["ItemThumb1"]))?$_FILES["ItemThumb1"]["name"]:"") ."",
'ResizeType' => "0",
'ResizeWidth' => "120",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End?>
<?php
// WA_UploadResult2 Params Start
$WA_UploadResult2_Params = array();
// WA_UploadResult2_1 Start
$WA_UploadResult2_Params["WA_UploadResult2_1"] = array(
'UploadFolder' => "../profilethumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_FILES["ItemThumb2"]))?$_FILES["ItemThumb2"]["name"]:"") ."",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult2_1 End
// WA_UploadResult2 Params End?>
<?php
// WA_UploadResult3 Params Start
$WA_UploadResult3_Params = array();
// WA_UploadResult3_1 Start
$WA_UploadResult3_Params["WA_UploadResult3_1"] = array(
'UploadFolder' => "../profilethumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_FILES["ItemThumb3"]))?$_FILES["ItemThumb3"]["name"]:"") ."",
'ResizeType' => "0",
'ResizeWidth' => "120",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult3_1 End
// WA_UploadResult3 Params End?>
<?php
// WA_UploadResult4 Params Start
$WA_UploadResult4_Params = array();
// WA_UploadResult4_1 Start
$WA_UploadResult4_Params["WA_UploadResult4_1"] = array(
'UploadFolder' => "../profilethumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_FILES["ItemThumb4"]))?$_FILES["ItemThumb4"]["name"]:"") ."",
'ResizeType' => "0",
'ResizeWidth' => "120",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult4_1 End
// WA_UploadResult4 Params End
?>
<?php?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "ItemThumb1", "0", "", "true", $WA_UploadResult1_Params);
}
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult2");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult2", "ItemThumb2", "0", "", "true", $WA_UploadResult2_Params);
}
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult3");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult3", "ItemThumb3", "0", "", "true", $WA_UploadResult3_Params);
}
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult4");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult4", "ItemThumb4", "0", "", "true", $WA_UploadResult4_Params);
}
?>
<?php?>
<?php?>
<?php?>
<?php