close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Parser errors and undefined index error

Thread began 9/07/2010 2:15 pm by cherry6767 | Last modified 9/16/2010 6:50 am by Jason Byrnes | 2598 views | 13 replies |

cherry6767

Parser errors and undefined index error

I am trying to get a receipt page sent through the email when it is loaded. The page is giving me the following error code:

Notice: Undefined index: eCartCheckoutForm_email in /checkout_success.php on line 18

Parse error: parse error, unexpected T_VARIABLE in /WA_Universal_Email/WAUE_checkout_success_1.php on line 340


The code that is on line 18 is: $RecipientEmail = "".$_SESSION['eCartCheckoutForm_email'] ."";include("WA_Universal_Email/WAUE_checkout_success_1.php");


Code from WAUE checkout success 1.php on line 340 is: $MailBody = $MailBody . "\r\n";


Any suggestions on what is going on?

Thank you

Sign in to reply to this post

anonymous

Hi Jennifer,

You may want to post the code from the entire page (WAUE_checkout_success_1.php). While line 340 is where the problem is creating the show stopper, my guess is that the issue is with a variable coming before line 340 that makes up that variable.

Regards,

Brian

Sign in to reply to this post

cherry6767

Thanks Brian

Here is the code:


<?php
$MailAttachments = "";
$MailBCC = "";
$MailCC = "";
$MailTo = "";
$MailBodyFormat = "";
$MailBody = "";
$MailImportance = "";
$MailFrom = "Country Ovens Online Orders|WA|orders@countryovens.com";
$MailSubject = "Country Ovens Order";
$_SERVER["QUERY_STRING"] = "";

//Global Variables

$WA_MailObject = WAUE_Definition("bizmail.yahoo.com","","orders@countryovens.com","Country Ovens","","");

if ($RecipientEmail) {
$WA_MailObject = WAUE_AddRecipient($WA_MailObject,$RecipientEmail);
}
else {
//To Entries
}

//Attachment Entries

//BCC Entries
$WA_MailObject = WAUE_AddBCC($WA_MailObject,"jennifer@countryovens.com");

//CC Entries

//Body Format
$WA_MailObject = WAUE_BodyFormat($WA_MailObject,2);

//Set Importance
$WA_MailObject = WAUE_SetImportance($WA_MailObject,"3");

//Start Mail Body
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . "&nbsp; Order Authorized Thank you for your order \r\n";
$MailBody = $MailBody . "Your order has been authorized and your payment accepted. \r\n";
$MailBody = $MailBody . "&nbsp; \r\n";
$MailBody = $MailBody . "You will be recieving an email confirmation shortly. \r\n";
$MailBody = $MailBody . "&nbsp; ";
//WA eCart Show If Start if (!$Countryovens->IsEmpty()) {
$MailBody = $MailBody . " Your Order \r\n";
$MailBody = $MailBody . " Name Description Price Quantity Total ";
while (!$Countryovens->EOF()) {
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " ";
$MailBody = $MailBody . $Countryovens->DisplayInfo("Name");
$MailBody = $MailBody . " ";
$MailBody = $MailBody . $Countryovens->DisplayInfo("Description");
$MailBody = $MailBody . " ";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->DisplayInfo("Price"));
$MailBody = $MailBody . " ";
$MailBody = $MailBody . $Countryovens->DisplayInfo("Quantity");
$MailBody = $MailBody . " ";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->DisplayInfo("TotalPrice"));
$MailBody = $MailBody . " ";
$Countryovens->MoveNext(); } $Countryovens->MoveFirst();
$MailBody = $MailBody . " Order Summary ";
//WA eCart Merchandizing Show Start //ecart="Countryovens" if ($Countryovens->GetDiscounts() > 0 || $Countryovens->GetCharges() > 0 || $Countryovens->GetShipping() > 0 || $Countryovens->GetTax() > 0) {
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " Sub-total ";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->TotalColumn("TotalPrice"));
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End //ecart="Countryovens" }
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start //ecart="Countryovens" if ($Countryovens->GetDiscounts() > 0) {
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " Discounts -";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GetDiscounts());
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End //ecart="Countryovens" }
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start //ecart="Countryovens" if ($Countryovens->GetCharges() > 0) {
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " Handling ";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GetCharges());
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End //ecart="Countryovens" }
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start //ecart="Countryovens" if ($Countryovens->GetShipping() > 0) {
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End //ecart="Countryovens" }
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start //ecart="Countryovens" if ($Countryovens->GetTax() > 0) {
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " Shipping ";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GetShipping());
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " Tax ";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GetTax());
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End //ecart="Countryovens" }
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " Total: ";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GrandTotal());
$MailBody = $MailBody . " ";
//WA eCart Show If Middle } else {
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " The cart is empty ";
//WA eCart Show If End }
$MailBody = $MailBody . " Fundraising Information ";
$MailBody = $MailBody . ((isset($_POST["PromoID"]))?$_POST["PromoID"]:"");
$MailBody = $MailBody . "&nbsp;";
$MailBody = $MailBody . ((isset($_POST["SchoolName"]))?$_POST["SchoolName"]:"");
$MailBody = $MailBody . " ";
$MailBody = $MailBody . ((isset($_POST["SellersName"]))?$_POST["SellersName"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " Billing Information ";
$MailBody = $MailBody . ((isset($_POST["firstname"]))?$_POST["firstname"]:"");
$MailBody = $MailBody . "&nbsp;";
$MailBody = $MailBody . ((isset($_POST["lastname"]))?$_POST["lastname"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
$MailBody = $MailBody . ((isset($_POST["street1"]))?$_POST["street1"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
$MailBody = $MailBody . ((isset($_POST["city"]))?$_POST["city"]:"");
$MailBody = $MailBody . ",&nbsp;";
$MailBody = $MailBody . ((isset($_POST["state_province"]))?$_POST["state_province"]:"");
$MailBody = $MailBody . "&nbsp;";
$MailBody = $MailBody . ((isset($_POST["postcode"]))?$_POST["postcode"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
$MailBody = $MailBody . ((isset($_POST["country"]))?$_POST["country"]:"");
$MailBody = $MailBody . " Shipping Information ";
$MailBody = $MailBody . ((isset($_POST["shipping_firstname"]))?$_POST["shipping_firstname"]:"");
$MailBody = $MailBody . "&nbsp;";
$MailBody = $MailBody . ((isset($_POST["shipping_lastname"]))?$_POST["shipping_lastname"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
$MailBody = $MailBody . ((isset($_POST["shipping_street1"]))?$_POST["shipping_street1"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
$MailBody = $MailBody . ((isset($_POST["shipping_city"]))?$_POST["shipping_city"]:"");
$MailBody = $MailBody . ",&nbsp;";
$MailBody = $MailBody . ((isset($_POST["shipping_state_province"]))?$_POST["shipping_state_province"]:"");
$MailBody = $MailBody . "&nbsp;";
$MailBody = $MailBody . ((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
$MailBody = $MailBody . ((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
$MailBody = $MailBody . ((isset($_POST["shipping_phone"]))?$_POST["shipping_phone"]:"");
$MailBody = $MailBody . " \r\n";
$MailBody = $MailBody . " \" /> GrandTotal() .\"\", \"\".AuthNet_RandomID() .\"\", \"USD\") //die(stop here)// ?>";
$MailBody = $MailBody . $WACalculatedHash[1];
$MailBody = $MailBody . "\" /> \" /> GrandTotal()?>\" /> TotalColumn(\"FullDetails\")?>\" /> TotalColumn(\"FullDetails\")?>\" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \" /> \r\n";
$MailBody = $MailBody . "&nbsp; \r\n";
$MailBody = $MailBody . "&nbsp; \r\n";
$MailBody = $MailBody . "&nbsp; <multipartbreak><html>\r\n";
$MailBody = $MailBody . "<link href=\"WA_eCart/CSS/eC_Simple_TahitiSea_Verdana.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n";
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;
}
}
$MailBody = $MailBody . "\r\n";
if ($Countryovens->IsEmpty()) {
$Countryovens->redirStr = "cart.php";
$Countryovens->cartAction = "RedirectIfEmpty";
}
$MailBody = $MailBody . "\r\n";
// WA eCart Redirect
if ($Countryovens->redirStr != "") {
header("Location: ".$Countryovens->redirStr);
}

Sign in to reply to this post

cherry6767

$MailBody = $MailBody . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n";
$MailBody = $MailBody . "<head></head><body>\r\n";
$MailBody = $MailBody . "<p>&nbsp;</p>\r\n";
$MailBody = $MailBody . "<div class=\"eC_Simple_TahitiSea_Verdana\" >\r\n";
$MailBody = $MailBody . " <h2>Order Authorized</h2>\r\n";
$MailBody = $MailBody . " <h3 class=\"eC_InfoHeader\" >Thank you for your order</h3>\r\n";
$MailBody = $MailBody . " <div class=\"eC_InfoContainer\" >\r\n";
$MailBody = $MailBody . " <p class=\"eC_OrderInfo\">Your order has been authorized and your payment accepted. </p>\r\n";
$MailBody = $MailBody . " <p class=\"eC_OrderInfo\">&nbsp;</p>\r\n";
$MailBody = $MailBody . " <p class=\"eC_OrderInfo\">You will be recieving an email confirmation shortly.</p>\r\n";
$MailBody = $MailBody . " <p class=\"eC_OrderInfo\">&nbsp;</p>\r\n";
$MailBody = $MailBody . " <div class=\"eC_Simple_TahitiSea_Verdana\">\r\n";
$MailBody = $MailBody . " ";
//WA eCart Show If Start
if (!$Countryovens->IsEmpty()) {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " <h2 class=\"eC_InfoContainer\">Your Order</h2>\r\n";
$MailBody = $MailBody . " <table class=\"eC_ShoppingCart\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n";
$MailBody = $MailBody . " <tr>\r\n";
$MailBody = $MailBody . " <th class=\"eC_InfoContainer\">Name</th>\r\n";
$MailBody = $MailBody . " <th class=\"eC_InfoContainer\">Description</th>\r\n";
$MailBody = $MailBody . " <th class=\"eC_InfoContainer\" >Price</th>\r\n";
$MailBody = $MailBody . " <th class=\"eC_InfoContainer\" >Quantity</th>\r\n";
$MailBody = $MailBody . " <th class=\"eC_InfoContainer\" >Total</th>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " ";
while (!$Countryovens->EOF()) {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " <tr>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">";
$MailBody = $MailBody . $Countryovens->DisplayInfo("Name");
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">";
$MailBody = $MailBody . $Countryovens->DisplayInfo("Description");
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\" >";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->DisplayInfo("Price"));
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\" >";
$MailBody = $MailBody . $Countryovens->DisplayInfo("Quantity");
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\" >";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->DisplayInfo("TotalPrice"));
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " ";
$Countryovens->MoveNext();
}
$Countryovens->MoveFirst();
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " </table>\r\n";
$MailBody = $MailBody . " <h3 class=\"eC_InfoContainer\">Order Summary</h3>\r\n";
$MailBody = $MailBody . " <div class=\"eC_OrderSummary\">\r\n";
$MailBody = $MailBody . " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"eC_CartSummary\">\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start
//ecart="Countryovens"
if ($Countryovens->GetDiscounts() > 0 || $Countryovens->GetCharges() > 0 || $Countryovens->GetShipping() > 0 || $Countryovens->GetTax() > 0) {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " <tr>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">Sub-total</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->TotalColumn("TotalPrice"));
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End
//ecart="Countryovens"
}
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start
//ecart="Countryovens"
if ($Countryovens->GetDiscounts() > 0) {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " <tr>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">Discounts</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">-";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GetDiscounts());
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End
//ecart="Countryovens"
}
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start
//ecart="Countryovens"
if ($Countryovens->GetCharges() > 0) {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " <tr>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">Handling</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GetCharges());
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End
//ecart="Countryovens"
}
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start
//ecart="Countryovens"
if ($Countryovens->GetShipping() > 0) {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End
//ecart="Countryovens"
}
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show Start
//ecart="Countryovens"
if ($Countryovens->GetTax() > 0) {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " <tr>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">Shipping</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GetShipping());
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " <tr>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">Tax</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GetTax());
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " ";
//WA eCart Merchandizing Show End
//ecart="Countryovens"
}
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " <tr class=\"eC_SummaryFooter\">\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">Total:</td>\r\n";
$MailBody = $MailBody . " <td class=\"eC_InfoContainer\">";
$MailBody = $MailBody . WA_eCart_DisplayMoney($Countryovens, $Countryovens->GrandTotal());
$MailBody = $MailBody . "</td>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " </table>\r\n";
$MailBody = $MailBody . " </div>\r\n";
$MailBody = $MailBody . " ";
//WA eCart Show If Middle
}
else {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . " <table>\r\n";
$MailBody = $MailBody . " <tr>\r\n";
$MailBody = $MailBody . " <td>The cart is empty</td>\r\n";
$MailBody = $MailBody . " </tr>\r\n";
$MailBody = $MailBody . " </table>\r\n";
$MailBody = $MailBody . " ";
//WA eCart Show If End
}

Sign in to reply to this post

anonymous

Jennifer,

I am looking to see if I can spot anything. Usually the t_variable problem is a result to an incorrect closure - like a missing curly brace or perhaps a variable creates a quotation that prematurely closes a statement that is still being evaluated. The other thing to check in your end is even the original declaration of PHP. A space between <? and "php" alone will throw that error.

Maybe Jason will have a more keen eye than myself but I am going to browse this to see what I can find.

Brian

Sign in to reply to this post

Jason ByrnesWebAssist

can you send the php file in a zip archive rather then directly pasting the code, it will be easier to look into the problem that way.

Sign in to reply to this post

cherry6767

here is the zip file.

Thank you so much for your help

Jen

Attached Files
WAUE_checkout_success_1.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

I found a number of potential problems in the file and removed them, try using this version instead:

Attached Files
WAUE_checkout_success_1.php.zip
Sign in to reply to this post

cherry6767

Thank you Jason but I am still getting the same errors.

Sign in to reply to this post

Jason ByrnesWebAssist

same exact error? or is it referencing a different line number?


try changing:

php:
/Start Mail Body*/ 

$MailBody = $MailBody . " \r\n";



to:

php:
/Start Mail Body*/

$MailBody = ""; 
$MailBody = $MailBody . " \r\n";




if you still have a problem, please post the error message, it may look like the same error, but the line number may be different.

Sign in to reply to this post
loading

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...