这段代码有什么问题,验证?

I have a piece of code which need to be validated for XHTML. I don't find any serious errors, but the w3 validator finds six errors and one warning:

  1. Error: Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.) At line 1, column 2 <?php↩ $PROGNAVN

  2. Warning: Comments seen before doctype. Internet Explorer will go into the quirks mode. From line 1, column 1; to line 3, column 2 <?php↩ $PROGNAVN = "Spare Siden &reg;";↩?>↩<!DOC

  3. Error: Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.) At line 11, column 2

    head>↩<body>↩↩<?php↩ echo "<h2

  4. Error: Stray end tag h2. From line 12, column 41; to line 12, column 45

    ROGNAVN ."</h2><br />

  5. Error: Text not allowed in element ol in this context. From line 15, column 12; to line 15, column 13 echo "<ol> ↩ <l Content model for element ol: Zero or more li and script-supporting elements.
  6. Error: Text not allowed in element ol in this context. From line 16, column 56; to line 16, column 57 g</a></li> ↩ <l Content model for element ol: Zero or more li and script-supporting elements.
  7. Error: Text not allowed in element ol in this context. From line 17, column 58; to line 17, column 59 r</a></li> ↩ < Content model for element ol: Zero or more li and script-supporting elements.

Validation picture

查看全部
dongzhuang1923
dongzhuang1923
2016/01/30 18:18
  • php
  • xhtml
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复