close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Digital File Pro to DataAsist Insert and Update pages Errors

Thread began 8/20/2009 3:57 am by Suggs | Last modified 8/24/2009 2:25 pm by Jason Byrnes | 3748 views | 5 replies |

Suggs

Digital File Pro to DataAsist Insert and Update pages Errors

Hi Folks,

Im using DataAssist and Digital File Pro and have followed the guides to insert and update DA file upload to existing Insert and Update pages.
When applied, i get the following message when trying to insert a new product:
Notice: Undefined index: WA_UploadResult1 in C:\Inetpub\wwwroot\Barker Backup\clearance\newcastle\admin\stock_Insert.php on line 15

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\wwwroot\Barker Backup\clearance\newcastle\admin\stock_Insert.php:15) in C:\Inetpub\wwwroot\Barker Backup\clearance\newcastle\admin\stock_Insert.php on line 22
Field 'Code' doesn't have a default value

On looking at it and comparing it with the backup file i made before i used DFP, ive noticed the following:
On the original backed up file, this looks like this:
$WA_connection = $global;
$WA_table = "stock";
$WA_sessionName = "WADA_Insert_stock";
$WA_redirectURL = "stock_Detail.php";
$WA_keepQueryString = false;
$WA_indexField = "ID";
$WA_fieldNamesStr = "Code|ProductName|ImageLge|Image|Description|Price|Category|Status";
$WA_fieldValuesStr = "".((isset($_POST["Code"]))?$_POST["Code"]:"") ."" . "|" . "".((isset($_POST["ProductName"]))?$_POST["ProductName"]:"") ."" . "|" . "".((isset($_POST["ImageLge"]))?$_POST["ImageLge"]:"") ."" . "|" . "".((isset($_POST["Image"]))?$_POST["Image"]:"") ."" . "|" . "".((isset($_POST["Description"]))?$_POST["Description"]:"") ."" . "|" . "".((isset($_POST["Price"]))?$_POST["Price"]:"") ."" . "|" . "".((isset($_POST["Category"]))?$_POST["Category"]:"") ."" . "|" . "".((isset($_POST["Status"]))?$_POST["Status"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);

The newly replaced file with DFP applied to it looks like this:
$WA_connection = $global;
$WA_table = "stock";
$WA_sessionName = "WADA_Insert_stock";
$WA_redirectURL = "stock_Detail.php";
$WA_keepQueryString = false;
$WA_indexField = "ID";
$WA_fieldNamesStr = "ImageLge";
$WA_fieldValuesStr = "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."";
$WA_columnTypesStr = "',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);

Can you advise on the best way forward to rectify this issue.

Best regards

Paul

Sign in to reply to this post

Jason ByrnesWebAssist

This is a code order error.

make sure the line that looks like:
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>

is at line 1 0f your page.

Sign in to reply to this post

Suggs

Hi Jason,
This has cured the initial error message, however when you insert a new product it just adds a blank entry into the database since adding DFP.

Any ideas?

Thanks

Paul

Sign in to reply to this post

Jason ByrnesWebAssist

Can you compress your page in a zip file and attach it to your replay so I can look at the code in it's entirety?

Sign in to reply to this post

Suggs

Hi Jason,
Attached is the page in its entirity complete with the DFP addition.
Ive also attached the original page zipped up which works fine without DFP so you can compare.

Cheers

Paul

Attached Files
stock_Insert_original.zip
stock_Insert_with_DFP.zip
Sign in to reply to this post

Jason ByrnesWebAssist

The code for the Digital File Pro upload is at lines 63 - 83:
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../gallery/images/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "300",
'ResizeHeight' => "220",
'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", "fileField", "0", "", "true", $WA_UploadResult1_Params);
}
?>



move this code to line 4 so the file is uploaded before the record is inserted.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...