By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,717 Members | 1,233 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,717 IT Pros & Developers. It's quick & easy.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'

P: 6
Hello to everyone.

I changed a few files on my site and when I tried to log into the admin area I got this message:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/secretsh/public_html/shop/admin/includes/boxes/catalog.php on line 31

Line 31 is line 16 below.

This is the code in the file:

Expand|Select|Wrap|Line Numbers
  1.  <?php
  2.   $heading = array();
  3.   $contents = array();
  4.  
  5.   $heading[] = array('text'  => BOX_HEADING_CATALOG,
  6.                      'link'  => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));
  7.  
  8.   if ($selected_box == 'catalog') {
  9.     $contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
  10.                                    '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
  11.                                    '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
  12.                                    '<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
  13.                                    '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
  14.                                    //kgt - discount coupons
  15.                                    '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'
  16.                                    '<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
  17.                                    /***************
  18.                                    '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
  19.                                    ***************/
  20.                                    //end kgt - discount coupons 
  21.   }
  22.  
  23.   $box = new box;
  24.   echo $box->menuBox($heading, $contents);
  25. ?>
  26.             </td>
  27.           </tr>
  28. <!-- catalog_eof //--> 
I can't figure out what's wrong. Can any expert offer an opinion?

Thanks in advance to anyone who can advise me.

Tanja.
Jun 4 '10 #1

✓ answered by Atli

You are missing a dot at the end of line 15.

If you want to add two strings, you need to use the dot to concatenate them:
Expand|Select|Wrap|Line Numbers
  1. // This produces an parse error
  2. $str = 'First' 'Second';
  3.  
  4. // It should be
  5. $str = 'First' . 'Second';
  6.  

Share this Question
Share on Google+
2 Replies


Atli
Expert 5K+
P: 5,058
You are missing a dot at the end of line 15.

If you want to add two strings, you need to use the dot to concatenate them:
Expand|Select|Wrap|Line Numbers
  1. // This produces an parse error
  2. $str = 'First' 'Second';
  3.  
  4. // It should be
  5. $str = 'First' . 'Second';
  6.  
Jun 4 '10 #2

P: 6
@Atli
Perfect! My problem is solved. Thank you!
Jun 4 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.