bravo14 Posted May 6, 2013 Share Posted May 6, 2013 Hi Guys I have checked the code over and over and have probably become word blind at the moment, I am getting an error saying Parse error syntax error, unexpected T_VARIABLE in /home/sites/Lucyslunchbox.co.uk/public_html/success.php on line 47 from the following code <?php require_once 'library/config.php'; require_once 'library/cart-functions.php'; require_once 'library/checkout-functions.php'; // if no order id defined in the session // redirect to main page if (!isset($_SESSION['orderId'])) { header("Location: http://www.lucyslunchbox.co.uk"); exit; } $pageTitle = 'Checkout Completed Successfully'; //require_once 'include/header.php'; //get order details $order_id=$_SESSION['order_id']; $order_sql=mysql_query("SELECT * FROM `tbl_order` where `od_id` = '$order_id'"); $order_row=mysql_fetch_assoc($order_sql); $message_intro="Dear ".$order_row['od_shipping_first_name']."\n\n Thank you for your order\n\n Your order will be delivered to:\n" .$order_row['od_shipping_address1']."\n" .$order_row['od_shipping_address2']."\n" .$order_row['od_shipping_city']."\n" .$order_row['od_shipping_state']."\n" .$order_row['od_shipping_postal_code']."\n on ".date("d-M-Y", strtotime($order_row['delDate']))."\n"; $order_items_sql=mysql_query("SELECT od_id, od.pd_id, od_qty, pd_name, pd_price, pd_thumbnail, pd.cat_id FROM tbl_order_item od, tbl_product pd, tbl_category cat WHERE od_id = '$order_id' AND od.pd_id = pd.pd_id AND cat.cat_id = pd.cat_id ")or die(mysql_error()); if(mysql_num_rows($order_items_sql)==0){ echo"No order items"; } else{ while($order_items_row=mysql_fetch_assoc($order_items_sql)){ Line 47 - $order_items=$order_items_row['od_qty'].' x '.$order_items_row['pd_name'].'@'$order_items_row['pd_price']; } } $mesage_content=$message_intro.$order_items; //send confirmation email $subject="Thank you for your order" $email=$order_row['od_email']; $message=$message_content; mail($email, $subject, $message, "From: orders@lucyslunchbox.co.uk\r\nReturn-path: orders@lucyslunchbox.co.uk"); // send notification email if ($shopConfig['sendOrderEmail'] == 'y') { $subject = "[New Order] " . $_SESSION['orderId']; $email = $shopConfig['$sc_order_email']; $message = "You have a new order. Check the order detail here \n http://" . $_SERVER['HTTP_HOST'] . WEB_ROOT . 'admin/order/index.php?view=detail&oid=' . $_SESSION['orderId'] ; mail($email, $subject, $message, "From: $email\r\nReturn-path: $email"); } unset($_SESSION['orderId']); ?> Any help would be great Quote Link to comment https://forums.phpfreaks.com/topic/277724-unexpected-t_vatriable/ Share on other sites More sharing options...
jazzman1 Posted May 6, 2013 Share Posted May 6, 2013 (edited) My IDE says: $order_items=$order_items_row['od_qty'].' x '.$order_items_row['pd_name'].'@'$order_items_row['pd_price']; //worng $mesage_content=$message_intro.$order_items //wrong $order_items=$order_items_row['od_qty'].' x '.$order_items_row['pd_name'].'@'.$order_items_row['pd_price']; //correct $mesage_content=$message_intro.$order_items; //correct Edited May 6, 2013 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/277724-unexpected-t_vatriable/#findComment-1428692 Share on other sites More sharing options...
gristoi Posted May 7, 2013 Share Posted May 7, 2013 $subject="Thank you for your order" // should be $subject="Thank you for your order"; Quote Link to comment https://forums.phpfreaks.com/topic/277724-unexpected-t_vatriable/#findComment-1428862 Share on other sites More sharing options...
jugesh Posted May 7, 2013 Share Posted May 7, 2013 end of every statement check ; is there or not? Quote Link to comment https://forums.phpfreaks.com/topic/277724-unexpected-t_vatriable/#findComment-1428867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.