W3 Validation with PHP includes?

Obsidian_Age

New member
Hi there,

I'm trying to fully validate one of my websites, which runs largely on PHP.

I have it set up in the (simplified) format of:

<?php include("header.php");?>
<p>Body</p>
<?php include("footer.php");?>

In the header the doctype, CSS and various other aspects are set.

In the footer I have:

<?php include("links.php");?>

Links.PHP simply lists my links in <ul> as such:

<ul>
<li><a href="aa">aa</a></li>
<li><a href="bb">bb</a></li>
</ul>

However, when I try to validate links.php it tells me that no doctype is set, which is true as I am not referencing header.php in the links.

I only see two ways to encorporate this; either inclue the header (which would also include all the formatting, producing drastic results), or add a doctype to the links (which would cause multiple doctypes in the index as it imports the links).

Is there some way to have all of these pages validated?
Perhaps something like 'if this page is not included()'?
Thanks for the reply.

My site has already been tested with IE, FF, Chrome, Opera and Safari, and appears to be fully functional.

I need it validated as I am using it for a University assignment that specifically requires me to have all pages validated -- another aspect is indeed to test them in all leading browsers.

It is however only a personal website, thus it does not get much traffic. Also, I don't think that my lecturer is going to be using a directory sniffer or guessing filenames, so I guess it will be OK to leave the included files unvalidated.
Also, I don't think that comparing yourself to failures with the attitude that "They're a huge company and their site doesn't have this feature" is the way to go. I prefer to compare myself to the best websites and strive to be as good as they are.

For example, take a look at McDonalds.co.nz -- there's over 150 McDonalds restraunts in New Zealand, yet their website is one of the most poorly-coded I have ever seen.
 
Back
Top