This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 8874 - PHP include issue
Summary: PHP include issue
Status: RESOLVED WONTFIX
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Marcin
QA Contact: Marcin
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-03 19:26 UTC by Marcin
Modified: 2015-08-23 07:07 UTC (History)
1 user (show)

See Also:


Attachments

Description Marcin 2010-02-03 19:26:39 UTC
this is my code

<?PHP echo '<'.'?xml version="1.0" encoding="utf-8"?'.'>'."\n"; ?>
<?xml-stylesheet type="text/css" href="CSS/ww2.historia.css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<?PHP
	//require("conn.inc.php");
	include('lib/funkcje.php');
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">

validator show me 2 errors and BOM warning:

Line 4, Column 1: document instance must start with document element 
&#65279;<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">

&#9993; 
   Line 4, Column 1: character data is not allowed here 
&#65279;<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">

&#9993; 

   You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include: 
putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes), or
using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.

everything is ok without include, onclude_once, require, require_once.
could you tell me how can i include something without errors?

the website is in my localhost server.
Comment 1 Michael[tm] Smith 2010-06-14 08:42:39 UTC
The validator is not intended to check PHP source (nor Perl source, nor Java, etc., source). It's instead for checking HTML and XHTML documents. What you need to do in order to validate your document is to instead check it after the PHP processor has generated HTML output from it.