tspek
11-11-2009, 04:06 PM
Site: www.thephotodictionary.com
Along the right side of the content, I have a small column to allow for news, and updates on the site. Since I want it to be the same on every page, I'm utilizing php.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>The Photo Dictionary--Photography tips, definitions, how-to articles </title>
<script type="text/javascript">
<!--
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
// -->
</script>
</head>
<body>
...
...
...
<div id="content">
<div>
<?php include('news.html');?>
</div>
<h2>The Photo Dictionary</h2>
<p>The Photo Dictionary has recently been revamped and all of the old content is in the process of being converted and uploaded. Please be patient during this process.</p>
...
...
news.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="right-content">
<h2>Recent News</h2>
<p><strong>11/10/2009</strong><br />
The new Photo Dictionary has luanched.</p>
</div>
</body>
</html>
So now I need to allow this to work via the .htaccess file
AddType application/x-httpd-php htm html php
AddHandler application/x-httpd-php .htm .html
This works fine, except then the page doesn't validate. I get this error:
# Error Line 35, Column 14: "DOCTYPE" declaration not allowed in instance
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:
✉
# Error Line 36, Column 43: document type does not allow element "html" here
<html xmlns="http://www.w3.org/1999/xhtml">
✉
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
# Error Line 35, Column 12: XML Parsing Error: StartTag: invalid element name
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:
Along the right side of the content, I have a small column to allow for news, and updates on the site. Since I want it to be the same on every page, I'm utilizing php.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>The Photo Dictionary--Photography tips, definitions, how-to articles </title>
<script type="text/javascript">
<!--
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
// -->
</script>
</head>
<body>
...
...
...
<div id="content">
<div>
<?php include('news.html');?>
</div>
<h2>The Photo Dictionary</h2>
<p>The Photo Dictionary has recently been revamped and all of the old content is in the process of being converted and uploaded. Please be patient during this process.</p>
...
...
news.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="right-content">
<h2>Recent News</h2>
<p><strong>11/10/2009</strong><br />
The new Photo Dictionary has luanched.</p>
</div>
</body>
</html>
So now I need to allow this to work via the .htaccess file
AddType application/x-httpd-php htm html php
AddHandler application/x-httpd-php .htm .html
This works fine, except then the page doesn't validate. I get this error:
# Error Line 35, Column 14: "DOCTYPE" declaration not allowed in instance
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:
✉
# Error Line 36, Column 43: document type does not allow element "html" here
<html xmlns="http://www.w3.org/1999/xhtml">
✉
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
# Error Line 35, Column 12: XML Parsing Error: StartTag: invalid element name
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: