n2diecast Posted October 30, 2009 Share Posted October 30, 2009 I have been looking at this line for several hours now and can not seem to see what is wrong. If you have any ideas it would be a great help. Error: PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in <td align="left" class="main"><?php echo '<a href="javascript:popupWindow('' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_ORDERS_PRINTABLE) . '?' . (tep_get_all_get_params(array('order_id')) . 'order_id=' . $HTTP_GET_VARS['order_id']) . '')">' . tep_template_image_button('button_printorder.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?></td> Thanks Mike Quote Link to comment https://forums.phpfreaks.com/topic/179580-problem-with-code/ Share on other sites More sharing options...
DavidAM Posted October 30, 2009 Share Posted October 30, 2009 <td align="left" class="main"><?php echo '<a href="javascript:popupWindow('' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_ORDERS_PRINTABLE) . '?' . (tep_get_all_get_params(array('order_id')) . 'order_id=' . $HTTP_GET_VARS['order_id']) . '')">' . tep_template_image_button('button_printorder.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?></td> Immediately after the "popupWindow(" there is a single quote, which closes the literal being echo'd. This is immediately followed by another single quote which would START a new literal except there is no operator to combine the strings. I suspect you are trying to put a literal single-quote in the string, if so, you have to escape it (also escape the one at the end of the parameter list): <td align="left" class="main"><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_ORDERS_PRINTABLE) . '?' . (tep_get_all_get_params(array('order_id')) . 'order_id=' . $HTTP_GET_VARS['order_id']) . '\')">' . tep_template_image_button('button_printorder.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?></td> [ code ] tages are a marvelous thing. See how the red shows literals and the blue shows variables (and green shows functions)? Quote Link to comment https://forums.phpfreaks.com/topic/179580-problem-with-code/#findComment-947608 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.