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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TanjaPetro
    New Member
    • Jun 2010
    • 6

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

    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_ENCA PSED_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:

    Code:
     <?php
      $heading = array();
      $contents = array();
    
      $heading[] = array('text'  => BOX_HEADING_CATALOG,
                         'link'  => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));
    
      if ($selected_box == 'catalog') {
        $contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
                                       '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
                                       '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
                                       '<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
                                       '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
                                       //kgt - discount coupons
                                       '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'
                                       '<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
                                       /***************
                                       '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
                                       ***************/
                                       //end kgt - discount coupons 
      }
    
      $box = new box;
      echo $box->menuBox($heading, $contents);
    ?>
                </td>
              </tr>
    <!-- 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.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    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:
    [code=php]
    // This produces an parse error
    $str = 'First' 'Second';

    // It should be
    $str = 'First' . 'Second';
    [/code]

    Comment

    • TanjaPetro
      New Member
      • Jun 2010
      • 6

      #3
      Originally posted 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:
      [code=php]
      // This produces an parse error
      $str = 'First' 'Second';

      // It should be
      $str = 'First' . 'Second';
      [/code]
      Perfect! My problem is solved. Thank you!

      Comment

      Working...