Hi Jason,
Here is the code. Also, Is there a way form me to attach file images to my posts if needed?
Thanks, Tony
<?php
//WA eCart Include
require_once("WA_eCart/eCart1_PHP.php");
?>
<?php require_once('Connections/MySQL_eCart.php'); ?>
<?php
$eCart1->GetContent();
?>
<?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;
}
}
mysql_select_db($database_MySQL_eCart, $MySQL_eCart);
$query_rsProduct = "SELECT * FROM items WHERE ItemID = 1 ORDER BY ItemID ASC";
$rsProduct = mysql_query($query_rsProduct, $MySQL_eCart) or die(mysql_error());
$row_rsProduct = mysql_fetch_assoc($rsProduct);
$totalRows_rsProduct = mysql_num_rows($rsProduct);
?>
<?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 = "";
$ATC_RedirectIfIn = "";
if (isset($totalRows_rsProduct) && $totalRows_rsProduct > 0) {
$row_rsProduct = WAEC_findRecordMySQL($rsProduct, "ItemID", $ATC_itemID);
if ($row_rsProduct) {
$ATC_itemName = "".$row_rsProduct['ItemName'] ."";// column binding
$ATC_itemDescription = "".$row_rsProduct['ItemShortDesc'] ."";// column binding
$ATC_itemThumbnail = "".$row_rsProduct['ItemThumb'] ."";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = "".$_POST["eCart1_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_rsProduct['ItemPrice'] ."");// column binding
mysql_data_seek($rsProduct, 0);
$row_rsProduct = mysql_fetch_assoc($rsProduct);
}
}
$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_itemThumbnail, $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'];
}
}
}
?>
<?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr);
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
#apDiv1 {
position:absolute;
left:10px;
top:23px;
width:182px;
height:138px;
z-index:1;
}
#apDiv2 {
position:absolute;
left:7px;
top:19px;
width:133px;
height:64px;
z-index:1;
}
#apDiv3 {
position:absolute;
left:211px;
top:21px;
width:276px;
height:128px;
z-index:2;
}
</style>
</head>
<body>
<div id="apDiv2">
<form name="eCart1_1_ATC_<?php echo $row_rsProduct["ItemID"]; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="eCart1_1_ID_Add" value="<?php echo $row_rsProduct["ItemID"]; ?>" >
<input type="text" name="eCart1_1_Quantity_Add" value="1" size="4" >
<input type="image" src="WA_eCart/Images/Pacifica/Btn4_EN_addtocart.gif" border="0" class="eC_ImageButton" value="Add to Cart" name="eCart1_1_ATC">
</form>
</div>
</body>
</html>
<?php
mysql_free_result($rsProduct);
?>