Cannot figure out This Parse error: syntax error, unexpected '<<' (T_SL) in C:\w

I am a php newbie and I have been working on a php script and it dispalys that i cannot find in the code, i have looked for it the best possible way, but cannot figure out.can somebody help?

Here is the error:

[php]Parse error: syntax error, unexpected ‘<<’ (T_SL) in C:\wamp\www\onlinestore\showcart.php on line 49[/php]

here is the script
[php]

<?php session_start(); $mysqli = mysqli_connect("localhost","root","","onlinestore"); $display_block = "

Your Shopping Cart

"; $get_cart_sql = "SELECT st.id, si.item_title, si.item_price, st.sel_item_qty, st.sel_item_size, st.sel_item_color FROM store_shoppertrack AS st LEFT JOIN store_items AS si ON si.id = st.set_item_id WHERE session_id = '".$_COOKIE['PHPSESSID']."'"; $get_cart_res = mysqli_query($mysqli, $get_cart_sql) or die(mysqli_error($mysqli)); if (mysqli_num_rows($get_cart_res) < 1) { $display_block .= "

You have no items in your cart. Please continue to shop

"; } else { $display_block .= <<<END_OF_TEXT END_OF_TEXT; while ($cart_info = mysqli_fetch_array($get_cart_res)) { $id = $cart_info['id']; $item_title = stripslashes($cart_info['item_title']); $item_price = $cart_info['item_price']; $item_qty = $cart_info['sel_item_qty']; $item_color = $cart_info['sel_item_color']; $item_size = $cart_info['sel_item_size']; $total_price = sprintf('%.02f', $item_price * $item_qty); $display_block .= <<< END_OF_TEXT; END_OF_TEXT; } $display_block .= "
Title Size Color Price Qty Total Price Action
$item_title
$item_size
$item_color
\$ $item_price
$item_qty
\$ $total_price remove
"; } mysqli_free_result($get_cart_res); mysqli_close($mysqli); ?>[/php]

In Heredoc there can be no spaces at the close

This must be COMPLETELY to the left with no spaces before it:

END_OF_TEXT;// OK
END_OF_TEXT;//BAD

Line 47 where you start the heredoc statement, also ends before you finish it.

[php]$var =<<<DELIMITER
stuff
DELIMITER;[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service