Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    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">
    <head>
    <title>PHP testing </title>
    </head>
    <body>
    </body>
    </html>


    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

    %xhtml-prefw-redecl.mod;
    -^


    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
    Last edited by Tails; 03-29-2004 at 06:01 PM.

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Try using echo to print the first line.

    I.e

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •