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

my code won't validate, help!

P: 2
this post concerns three pages.

1. this page: http://www.katherine-designs.com/sendemail.php i get the following errors:

# Error Line 59, Column 135: end tag for "img" omitted, but OMITTAG NO was specified

…lance design and illustration" ></a>

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 59, Column 35: start tag was here

<div id="top"><a href="index.html"><img src="img/header_name.gif" alt="Katherine

# Error Line 79, Column 10: end tag for "div" omitted, but OMITTAG NO was specified

Use ba…



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 76: start tag was here

><div id="contact">

# Error Line 79, Column 10: end tag for "div" omitted, but OMITTAG NO was specified

Use ba…



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 57: start tag was here

><div id="wrapper">

# Error Line 79, Column 10: end tag for "body" omitted, but OMITTAG NO was specified

Use ba…



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 56: start tag was here

><body>

# Error Line 79, Column 10: end tag for "html" omitted, but OMITTAG NO was specified


Use ba…



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 2: start tag was here

><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

# Error Line 59, Column > 80: XML Parsing Error: Opening and ending tag mismatch: img line 59 and a

…="img/header_name.gif" alt="Katherine Valenzuela - Freelance design and illus…


# Error Line 74, Column 6: XML Parsing Error: Opening and ending tag mismatch: a line 59 and div

</div>


# Error Line 79, Column 9: XML Parsing Error: Premature end of data in tag div line 76

Use back!


# Error Line 79, Column 9: XML Parsing Error: Premature end of data in tag div line 59

Use back!


# Error Line 79, Column 9: XML Parsing Error: Premature end of data in tag div line 57

Use back!


# Error Line 79, Column 9: XML Parsing Error: Premature end of data in tag body line 56

Use back!


# Error Line 79, Column 9: XML Parsing Error: Premature end of data in tag html line 2

Use back!
a lot of it seems to deal with the PHP code i inserted to the page. as my PHP skills are close to nil, i'm wary about fiddling with it myself. =\

2. now this page: http://www.katherine-designs.com/contact.php

i get these errors:

1. Error Line 81, Column 54: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

2. Error Line 82, Column 47: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

<input type="hidden" name="httpref" value="" />

3. Error Line 83, Column 68: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
I tried to insert the input fields into divs because that seems to work for some people. Didn't work for me.

3. Finally, this page: http://www.katherine-designs.com/

# Warning Line 83, Column 92: cannot generate system identifier for general entity "count"

…oh_k.json?callback=twitterCallback2&count=2" type="text/javascript"></script>



An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.

If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.

Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
# Error Line 83, Column 92: general entity "count" not defined and no default entity

…oh_k.json?callback=twitterCallback2&count=2" type="text/javascript"></script>



This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
# Warning Line 83, Column 97: reference not terminated by REFC delimiter

…json?callback=twitterCallback2&count=2" type="text/javascript"></script>



If you meant to include an entity that starts with "&", then you should terminate it with ";". Another reason for this error message is that you inadvertently created an entity by failing to escape an "&" character just before this text.
# Warning Line 83, Column 97: reference to external entity in attribute value

…json?callback=twitterCallback2&count=2" type="text/javascript"></script>



This is generally the sign of an ampersand that was not properly escaped for inclusion in an attribute, in a href for example. You will need to escape all instances of '&' into '&amp;'.
# Error Line 83, Column 97: reference to entity "count" for which no system identifier could be generated

…json?callback=twitterCallback2&count=2" type="text/javascript"></script>



This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
# Info Line 83, Column 90: entity was defined here

…e/oh_k.json?callback=twitterCallback2&count=2" type="text/javascript"></scri…

# Error Line 83, Column > 80: XML Parsing Error: EntityRef: expecting ';'

…er_timeline/oh_k.json?callback=twitterCallback2&count=2" type="text/javascrip…
The errors are coming from the Twitter 'widget' code I inserted to my page. I can't any alternatives that validate well in XHTML 1.0 Strict so any help would be greatly appreciated!
Dec 29 '09 #1
Share this Question
Share on Google+
2 Replies


Dormilich
Expert Mod 5K+
P: 8,639
with the exception of 2., all these are XML errors.

basically, you need to understand, that you validate after XHTML, which uses the very strict constraints of XML. an immediate solution would be to use HTML 4.01 instead of XHTML 1.0. otherwise you need to learn about the structure and rules of XML documents.
XML specification
XHTML specification
Dec 29 '09 #2

P: 2
thanks! i switched to html 4.01 transitional and it fixed most bugs, save for the following:

address: http://www.katherine-designs.com/sendemail.php

i get the following errors:

Validation Output: 2 Errors

1. Error Line 88, Column 10: end tag for "DIV" omitted, but its declaration does not permit this

Use ba…


* You forgot to close a tag, or
* you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.

The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
2. Info Line 85: start tag was here

><div id="contact">

3. Error Line 88, Column 10: end tag for "DIV" omitted, but its declaration does not permit this

Use ba…


* You forgot to close a tag, or
* you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.

The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
4. Info Line 66: start tag was here

><div id="wrapper">
here is my code:

Expand|Select|Wrap|Line Numbers
  1.     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.             "http://www.w3.org/TR/html4/loose.dtd">
  3.  
  4.     <head>
  5. <meta name="description" content="web and graphic design services" >
  6. <meta name="keywords" content="HTML,CSS,Design,Print,Web" >
  7. <meta name="author" content="Katherine Designs - freelance designer" >
  8. <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" >
  9.  
  10.         <title>Katherine Designs - Freelance Web and Graphic Designer</title>
  11.  
  12.  
  13.         <style type="text/css" media="screen">
  14.             @import url(styles.css);
  15.         </style>
  16.  
  17. <style type="text/css" media="screen">
  18. body  {
  19.  
  20. background-image: url(img/bg_contact.png);
  21. }-
  22. </style>
  23.  
  24.     <script type="text/javascript" charset="utf-8">
  25.  
  26.     function roll1(whichPic, whichImage){
  27.         document.images.pic1.src = "img/header_about_rollover.gif";
  28.     }
  29.  
  30.     function change1(whichPic){
  31.         document.images.pic1.src="img/header_about_off.gif";
  32.     }
  33.  
  34.     function roll2(whichPic, whichImage){
  35.         document.images.pic2.src = "img/header_portfolio_rollover.gif";
  36.     }
  37.  
  38.     function change2(whichPic){
  39.         document.images.pic2.src="img/header_portfolio_off.gif";
  40.     }
  41.  
  42.     function roll3(whichPic, whichImage){
  43.         document.images[whichPic].src = "img/header_services_rollover.gif";
  44.     }
  45.  
  46.     function change3(whichPic){
  47.         document.images[whichPic].src="img/header_services_off.gif";
  48.     }
  49.  
  50.     function roll4(whichPic, whichImage){
  51.         document.images[whichPic].src = "img/header_contact_rollover.gif";
  52.     }
  53.  
  54.     function change4(whichPic){
  55.         document.images[whichPic].src="img/header_contact_off.gif";
  56.     }
  57.  
  58.  
  59.     </script>
  60.  
  61.  
  62.  
  63.  
  64.     </head>
  65. <body>
  66. <div id="wrapper">
  67.  
  68. <div id="top"><a href="index.html"><img src="img/header_name.gif" alt="Katherine Valenzuela - Freelance design and illustration"  ></a>
  69.  
  70.  
  71. <a href="about.html" onmouseover="roll1('pic1','img/header_about_rollover.gif')" onmouseout="change1('pic1')">
  72. <img src="img/header_about_off.gif" id="pic1" name="pic1" class="navi" alt="About" ></a>
  73. &nbsp;&nbsp;
  74. <a href="portfolio.html" onmouseover="roll2('pic2','img/header_portfolio_rollover.gif')" onmouseout="change2('pic2')">
  75. <img src="img/header_portfolio_off.gif" id="pic2" name="pic2" alt="Portfolio" ></a>
  76. &nbsp;&nbsp;
  77. <a href="services.html" onmouseover="roll3('pic3','img/header_services_rollover.gif')" onmouseout="change3('pic3')">
  78. <img src="img/header_services_off.gif" id="pic3" name="pic3" alt="Services" ></a>
  79. &nbsp;&nbsp;
  80.  
  81. <img src="img/header_contact_on.gif" alt="Contact" >
  82.  
  83. </div>
  84.  
  85. <div id="contact">
  86. <img src="img/contact_title.gif" alt="Contact form" ><br ><br >
  87. <?php
  88.  
  89. $ip = $_POST['ip'];
  90. $httpref = $_POST['httpref'];
  91. $httpagent = $_POST['httpagent'];
  92. $visitor = $_POST['visitor'];
  93. $visitormail = $_POST['visitormail'];
  94. $notes = $_POST['notes'];
  95. $visitorhttp = $_POST['visitorhttp'];
  96.  
  97.  
  98. if (eregi('http:', $notes)) {
  99. die ("Do NOT try that! ");
  100. }
  101. if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
  102. {
  103. echo "Use Back - Enter valid e-mail\n";
  104. $badinput = "Feedback was NOT submitted\n";
  105. echo $badinput;
  106. die ("Go back! ");
  107. }
  108.  
  109. if(empty($visitor) || empty($visitormail) || empty($notes )) {
  110. echo "Use Back - fill in all fields\n";
  111. die ("Use back!");
  112. }
  113.  
  114. $todayis = date("l, F j, Y, g:i a") ;
  115.  
  116. $visitorhttp = $visitorhttp ;
  117. $subject = $visitorhttp;
  118.  
  119. $notes = stripcslashes($notes);
  120.  
  121. $message = " $todayis [EST] \n
  122. Attention: $visitorhttp \n
  123. Message: $notes \n
  124. From: $visitor ($visitormail)\n
  125. Additional Info : IP = $ip \n
  126. Browser Info: $httpagent \n
  127. Referral : $httpref \n
  128. ";
  129.  
  130. $from = "From: $visitormail\r\n";
  131.  
  132.  
  133. mail("hello@katherine-designs.com", $subject, $message, $from);
  134.  
  135. ?>
  136.  
  137.  
  138. <b>Date:</b> <?php echo $todayis ?><br >
  139. <b>Your email:</b> <?php echo $visitormail ?>
  140. <br >
  141. <b>Your website:</b> <?php echo $visitorhttp ?>
  142.  
  143. <br ><br >
  144. Thank you, <?php echo $visitor ?>! Your message has been received and I will get back to your shortly.
  145. <br ><br >
  146. <b>Here is your message:</b><br >
  147. <?php $notesout = str_replace("\r", "<br>", $notes);
  148. echo $notesout; ?>
  149. <br >
  150. <br ><?php echo $ip ?>
  151.  
  152. <br ><br >
  153. <a href="contact.php">Back to the Form page</a>
  154.  
  155. </div>
  156.  
  157. <div id="bottom">&nbsp;</div>
  158. <br ><br >
  159. </div>
  160. </body>
  161. </html>
2. address: http://www.katherine-designs.com

i get the following errors:

Validation Output: 2 Errors

1. Warning Line 85, Column 92: cannot generate system identifier for general entity "count"

…oh_k.json?callback=twitterCallback2&count=2" type="text/javascript"></script>



An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.

If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.

Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
2. Error Line 85, Column 92: general entity "count" not defined and no default entity

…oh_k.json?callback=twitterCallback2&count=2" type="text/javascript"></script>



This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
3. Error Line 85, Column 97: reference to entity "count" for which no system identifier could be generated

…json?callback=twitterCallback2&count=2" type="text/javascript"></script>



This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
4. Info Line 85, Column 90: entity was defined here

…e/oh_k.json?callback=twitterCallback2&count=2" type="text/javascript"></scri…
my code:

Expand|Select|Wrap|Line Numbers
  1.     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.             "http://www.w3.org/TR/html4/loose.dtd">
  3.  
  4.     <head>
  5. <meta name="description" content="web and graphic design services">
  6. <meta name="keywords" content="HTML,CSS,Design,Print,Web">
  7. <meta name="author" content="Katherine Designs - freelance designer">
  8. <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  9.  
  10.         <title>Katherine Designs - Freelance Web and Graphic Designer</title>
  11.  
  12.  
  13.         <style type="text/css" media="screen">
  14.             @import url(styles.css);
  15.         </style>
  16.  
  17.     <script type="text/javascript" charset="utf-8">
  18.  
  19.     function roll1(whichPic, whichImage){
  20.         document.images.pic1.src = "img/header_about_rollover.gif";
  21.     }
  22.  
  23.     function change1(whichPic){
  24.         document.images.pic1.src="img/header_about_off.gif";
  25.     }
  26.  
  27.     function roll2(whichPic, whichImage){
  28.         document.images.pic2.src = "img/header_portfolio_rollover.gif";
  29.     }
  30.  
  31.     function change2(whichPic){
  32.         document.images.pic2.src="img/header_portfolio_off.gif";
  33.     }
  34.  
  35.     function roll3(whichPic, whichImage){
  36.         document.images[whichPic].src = "img/header_services_rollover.gif";
  37.     }
  38.  
  39.     function change3(whichPic){
  40.         document.images[whichPic].src="img/header_services_off.gif";
  41.     }
  42.  
  43.     function roll4(whichPic, whichImage){
  44.         document.images[whichPic].src = "img/header_contact_rollover.gif";
  45.     }
  46.  
  47.     function change4(whichPic){
  48.         document.images[whichPic].src="img/header_contact_off.gif";
  49.     }
  50.  
  51.  
  52.     </script>
  53.  
  54.  
  55.     </head>
  56. <body>
  57. <div id="wrapper">
  58.  
  59. <div id="top"><a href="index.html"><img src="img/header_name.gif" alt="Katherine Designs - Freelance Web and Graphic Designer"></a>
  60.  
  61.  
  62. <a href="about.html" onmouseover="roll1('pic1','img/header_about_rollover.gif')" onmouseout="change1('pic1')">
  63. <img src="img/header_about_off.gif" id="pic1" name="pic1" class="navi" alt="About"></a>
  64. &nbsp;&nbsp;
  65. <a href="portfolio.html" onmouseover="roll2('pic2','img/header_portfolio_rollover.gif')" onmouseout="change2('pic2')">
  66. <img src="img/header_portfolio_off.gif"  id="pic2" name="pic2" alt="Portfolio"></a>
  67. &nbsp;&nbsp;
  68. <a href="services.html" onmouseover="roll3('pic3','img/header_services_rollover.gif')" onmouseout="change3('pic3')">
  69. <img src="img/header_services_off.gif"  id="pic3" name="pic3" alt="Services"></a>
  70. &nbsp;&nbsp;
  71. <a href="contact.php" onmouseover="roll4('pic4','img/header_contact_rollover.gif')" onmouseout="change4('pic4')">
  72. <img src="img/header_contact_off.gif"  id="pic4" name="pic4" alt="Contact"></a>
  73.  
  74. </div>
  75.  
  76. <div id="main"><img src="img/hello.gif" alt="Hello! I'm Katherine, a freelance designer and illustrator based in Toronto, Canada. Welcome to my portfolio."></div>
  77.  
  78. <div id="bottom-left">
  79. <img src="img/tweets.gif" alt="Latest Tweets">
  80. <br><br>
  81. <div  id="twitter_update_list"></div><br>
  82. <a id="twitter-link" style="display:block;text-align:right;" href="http://twitter.com/oh_k">follow me on Twitter</a>
  83.  
  84. <script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>
  85. <script src="http://twitter.com/statuses/user_timeline/oh_k.json?callback=twitterCallback2&count=2" type="text/javascript"></script>
  86.  
  87.  
  88. </div>
  89.  
  90. <div id="bottom-right">
  91. <img src="img/whats_happening.gif" alt="What's happening"><br><br>Hello, and welcome! I'm currently open to design inquiries. Feel free to use the <a href="contact.php">contact form</a> to get in touch with me!
  92. <br><br><br>&nbsp;
  93. </div>
  94. </div>
  95. </body>
  96. </html>
Dec 29 '09 #3

Post your reply

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