Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2009
    Location
    uk
    Posts
    111
    Plugin Contributions
    0

    Default PHP Parse error: syntax error, unexpected T_STRING

    After my last upload my home page is blank and I am getting the following error message from the report -
    PHP Parse error: syntax error, unexpected T_STRING in /home/xxxxxxx/public_html/includes/modules/classic/meta_tags.php on line 48

    I cannot see anything missing - can you ?

    $keywords_string_metatags .= zen_clean_html($keywords_metatags->fields['categories_name']) . METATAGS_DIVIDER;
    $keywords_metatags->MoveNext();
    }
    define('KEYWORDS', str_replace('"','',zen_clean_html($keywords_string_metatags) . CUSTOM_KEYWORDS));

    // if per-page metatags overrides have been defined, use those, otherwise use usual defaults:
    if ($current_page_base != 'index') {
    if (defined('META_TAG_TITLE_' . strtoupper($current_page_base))) define('META_TAG_TITLE', constant('META_TAG_TITLE_' . strtoupper($current_page_base)));
    if (defined('META_TAG_DESCRIPTION_' . strtoupper($current_page_base))) define('META_TAG_DESCRIPTION', constant('META_TAG_DESCRIPTION_' . strtoupper($current_page_base)));
    if (defined('META_TAG_KEYWORDS_' . strtoupper($current_page_base))) define('META_TAG_KEYWORDS', constant('META_TAG_KEYWORDS_' . strtoupper($current_page_base)));
    }

    //// Get different meta tag values depending on main_page values
    switch ($_GET['main_page']) {
    case ($this_is_home_page == true):
    define('META_TAG_TITLE', 'Women's boots sale ShoeShop UK,');
    define('META_TAG_DESCRIPTION', 'Find all women's boots sale at shoeshop uk and enjoy a variety of popular styles to complement any ensemble. Choose womens boots on sale in tall, mid length and ankle length to accentuate your wardrobe

    thanks for reading
    Thanks to those that offer help

    http://www.shoeshop-uk.com

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: PHP Parse error: syntax error, unexpected T_STRING

    Your define statements use single quotes to enclose text, but you also have single quotes inside your text. This causes the code to think the text ends prematurely, and leaves fatal PHP errors dangling.

    You need to escape these single quotes with a backslash \ like this \' :

    define('META_TAG_TITLE', 'Women\'s boots sale ShoeShop UK,');
    define('META_TAG_DESCRIPTION', 'Find all women\'s boots sale at shoeshop uk and enjoy a variety of popular styles to complement any ensemble. Choose womens boots on sale in tall, mid length and ankle length to accentuate your wardrobe

  3. #3
    Join Date
    Jun 2009
    Location
    uk
    Posts
    111
    Plugin Contributions
    0

    Default Re: PHP Parse error: syntax error, unexpected T_STRING

    Quote Originally Posted by gjh42 View Post
    Your define statements use single quotes to enclose text, but you also have single quotes inside your text. This causes the code to think the text ends prematurely, and leaves fatal PHP errors dangling.

    You need to escape these single quotes with a backslash \ like this \' :

    define('META_TAG_TITLE', 'Women\'s boots sale ShoeShop UK,');
    define('META_TAG_DESCRIPTION', 'Find all women\'s boots sale at shoeshop uk and enjoy a variety of popular styles to complement any ensemble. Choose womens boots on sale in tall, mid length and ankle length to accentuate your wardrobe

    I tried with back slash but it still didnt worek so have taken \' out completely.
    Thanks though
    Thanks to those that offer help

    http://www.shoeshop-uk.com

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: PHP Parse error: syntax error, unexpected T_STRING

    Okay, I wasn't certain that a single escape layer would work, since the text might be handled more than once on its way to the page. Safest to avoid the problem, though it would be good to know exactly what steps would fully escape those characters, whether a double escape \\\' to leave \' on the first pass and ' in output, or what.

 

 

Similar Threads

  1. PHP Parse error: syntax error, unexpected T_STRING
    By absoluteblock in forum General Questions
    Replies: 4
    Last Post: 2 Oct 2011, 03:40 AM
  2. Replies: 20
    Last Post: 21 Nov 2010, 02:48 AM
  3. Replies: 9
    Last Post: 5 Feb 2010, 01:12 AM
  4. Replies: 3
    Last Post: 13 Mar 2009, 05:20 PM
  5. Replies: 6
    Last Post: 21 Sep 2008, 04:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR