Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-29-2004, 05:45 PM #1
- Join Date
- Nov 2002
- Thanked 1 Time in 1 Post
XHTML 1.1 Doctype displays error in PHP pages
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
03-29-2004, 11:06 PM #2
- Join Date
- Jun 2002
- Winona, MN - The land of 10,000 lakes
- Thanked 45 Times in 42 Posts
Try using echo to print the first line.
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";