Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    Default Re: HTML Validation & Zen-Cart

    This is crazy. I changed only one line in tpl_header.php and now HTML validation yields no errors at all (on the test site. for simplicity sake let's limit the discussion to the test site only).

    Here is what I did. I changed from:
    PHP Code:
    <?php echo '<a href="index.php?main_page=index&amp;cPath=2">' zen_image($template->get_template_dir(HEADER_CATEGORIES_TABS1DIR_WS_TEMPLATE$current_page_base,'images'). '/' .
            
    HEADER_CATEGORIES_TABS1HEADER_CATEGORIES_TABS1_ALT) . '</a>'?>
    To:
    PHP Code:
    <?php echo '<a href="index.php?main_page=index' htmlspecialchars('&') . 'cPath=2">' zen_image($template->get_template_dir(HEADER_CATEGORIES_TABS1DIR_WS_TEMPLATE$current_page_base,'images'). '/' .
            
    HEADER_CATEGORIES_TABS1HEADER_CATEGORIES_TABS1_ALT) . '</a>'?>
    I left the two other (faulty?) lines as they are.

    Any explanation for this?

    Why does htmlspecialchars('&') work whereas '&amp;' doesn't?

  2. #12
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,019
    Plugin Contributions
    61

    Default Re: HTML Validation & Zen-Cart

    Cheers... you see one error often causes a whole string in the validator =-)

    ~Melanie
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

  3. #13
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    Default Re: HTML Validation & Zen-Cart

    Quote Originally Posted by mprough View Post
    Cheers... you see one error often causes a whole string in the validator =-)
    Thank you, Melanie.

    I am still troubled by the fact that I don't understand why the HTML validator considers the first '&amp;' an error, while the others aren't.

    Also, is there really a difference between htmlspecialchars('&') and '&amp;'?

  4. #14
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,019
    Plugin Contributions
    61

    Default Re: HTML Validation & Zen-Cart

    All unescaped ampersands will produce an error. The difference as you asked is likely related to your site, code or hosting and is in the parsing engine.... No worries though, these things happen.

    ~Melanie
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. HTML Validation almost perfect
    By zcnb in forum General Questions
    Replies: 1
    Last Post: 7 May 2009, 02:48 PM
  2. W3C HTML validation help
    By Doodlebuckets in forum General Questions
    Replies: 4
    Last Post: 5 Aug 2008, 08:18 PM

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