close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Trouble adding item from Recordset...

Thread began 11/12/2009 7:45 am by fdotmedia | Last modified 11/12/2009 4:12 pm by Jason Byrnes | 1186 views | 3 replies |

fdotmedia

Trouble adding item from Recordset...

I have got the dynamic portion of the script working so it adds the product. But when I set up the scipt to redirect on add it doesn't go anywhere, so you have to click on the "view cart" button to actually view the cart...

any suggestions?

see code below...

<?php
//WA eCart Include
require_once("WA_eCart/eCart1_PHP.php");
?>
<?php
$eCart1->GetContent();
?>
<?php
// WA eCart AddToCart
if (isset($_POST["eCart1_1_ATC"]) || isset($_POST["eCart1_1_ATC_x"])) {
$ATC_itemID = $_POST["eCart1_1_ID_Add"];
$ATC_AddIfIn = 0;
$ATC_RedirectAfter = "shopping-cart.php";
$ATC_RedirectIfIn = "";
if (isset($totalRows_LabTest) && $totalRows_LabTest > 0) {
$row_LabTest = WAEC_findRecordMySQL($LabTest, "LID", $ATC_itemID);
if ($row_LabTest) {
$ATC_itemName = "".$row_LabTest['LabTitle'] ."";// column binding
$ATC_itemDescription = "";// column binding
$ATC_itemWeight = floatval("".$row_LabTest['LabWeight'] ."");// column binding
$ATC_itemQuantity = "".$_POST["eCart1_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_LabTest['LabPrice'] ."");// column binding
mysql_data_seek($LabTest, 0);
$row_LabTest = mysql_fetch_assoc($LabTest);
}
}
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$eCart1->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice);
if ($ATC_RedirectAfter != "" && $eCart1->redirStr == "") {
$eCart1->redirStr = $ATC_RedirectAfter;
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
}
else {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
}
}
}
?>
Sign in to reply to this post

Jason ByrnesWebAssist

There may be a PHP error occurring on the page causing the redirect to faile.


Add the following code at line 1:

php:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>



to turn error reporting on.

please post back the error that is occurring, also if you could add the php page to a zip archive and attach it to your replay so I could see the entire code on the page, that would help me see what is going wrong.

Sign in to reply to this post

fdotmedia

I don't get an error... I'd attach that as well...

Please let me know when you have a second...

Ted

Attached Files
lab-test-details.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

Add the following code just before the doctype tag:

php:
<?php

// WA eCart Redirect
if ($eCart1->redirStr != "")     {
  
header("Location: ".$eCart1->redirStr);
}
?>
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...