Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsWeb DesignWeb Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 2nd, 2011, 09:51 AM
onlinespider onlinespider is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2011
Posts: 2 onlinespider User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 56 sec
Reputation Power: 0
Integrating index.php file with header.php file

I am trying to use a separate php file to make a header, which will be common to all my pages. Although it is working, when I try to validate my [PHPNET]index.php[/PHPNET] page I am getting an error saying:



Line 96, Column 70: document type does not allow element "html" here <html>
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).
Line 169, Column 8: end tag for "head" which is not finished </head>
Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>
Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists require appropriate list items (<ul> and <ol> require <li>; <dl> requires <dt> and <dd>), and so on.


My files are contructed in this way (simplified to give an explanation):



index.php File Code

<html>
<head>
<link rel="stylesheet" type="text/css" href="URL address" />
</head>
<body>

<?php
require("header.php");
?>

</body>
</html>



Header.php File Code

<html>
<head>

<style type="text/css">
css header code…….
</style>

</head>
<body>
Html header code…..
</body>
</html>



Template.css File Code

Other css code included here related to index.php …….



I tried different ways but I am not finding a solution. I wish to clear up these validation errors but at the same time using a common php header to facilitate website updates.

Thank you in advance for your help.
Much appreciated !

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Development > Integrating index.php file with header.php file


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap