View Full Version : XHTML 1.1 Doctype displays error in PHP pages

03-29-2004, 05:45 PM
I just wanted to make a sample PHP page to test things as I go through some tutorials. But the DOCTYPE of my page is throwing errors. The page content is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<title>PHP testing </title>

The error is:
Parameter entity must be defined before it is used. Error processing resource 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'. Line 85, Position 2


There's not 85 lines in my page, and it's claiming the error is in the dtd (browsers read those upon each page parse?). But the page works fine if I remove the XML declaration. I don't know why that causes problems. I don't have PHP shorttags on. This is just an ordinary page with the exception of having a PHP extension.

EDIT: apparently I forgot to turn my server on :rolleyes:

03-29-2004, 11:06 PM
Try using echo to print the first line.


echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";