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 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2002
    Location
    Moncton, N.B., Canada
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parse Error in XHTML Doctype

    Hi,

    I'm running into a weird problem. I installed phpDev with Apache on my computer (Windows XP) and my pages on localhost display fine without a doctype but when I try and put in an XHTML compliant page I get the following error:

    Parse error: parse error in c:\phpdev\www\public\castle\index.htm on line 1


    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Baie Ste. Anne Building Supplies</title>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    
    <link rel="stylesheet" type="text/css" href="css/babsStyle.css">
    
    <script type="text/javascript" src="js/babs.js">
    </script>
    
    </head>
    <body> 
    
    etc....
    - Terry

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    turn short_tags off in your ini

    <? <--- is read as <?php by the parser
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    The PHP engine shouldn't be parsing that file anyways if it has a .htm extension unless you set your configuration to parse all .htm or .html files as .php.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    New Coder
    Join Date
    Sep 2002
    Location
    Moncton, N.B., Canada
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The parser is getting confused by the question marks in
    <?xml version="1.0" encoding="iso-8859-1"?>

    right?

    Is the PHP engine thinking that I'm dropping into php script...

    This particular file is a straight xhtml file but I was getting an error on my localhost... phpdev. That's why I posted this in PHP.

    I was posting from my work. At home I'm working on IIS with php installed as a dll module and I've never had a problem with xhtml doctypes on localhost. Why is the Apache server is different? What does short_tags do? I can't find that variable in my ini file.

    Thanks,
    Terry

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe you have different php.ini files for your php setups? Anyway, the configuration option is called short_open_tag, and here's also something in the manual about it: http://www.php.net/manual/en/configu...directives.php (the first config option it is).

  • #6
    New Coder
    Join Date
    Sep 2002
    Location
    Moncton, N.B., Canada
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, that's what I was looking for. I think I'll just php echo out the xml version. I should use the manuals more often

    Terry


  •  

    Posting Permissions

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