...

View Full Version : Parse Error in XHTML Doctype



Terry
04-02-2003, 05:02 PM
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




<?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

Íkii
04-02-2003, 05:51 PM
turn short_tags off in your ini :)

<? <--- is read as <?php by the parser

Spookster
04-02-2003, 10:38 PM
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.

Terry
04-03-2003, 02:14 AM
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

mordred
04-03-2003, 11:10 AM
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/configuration.directives.php (the first config option it is).

Terry
04-03-2003, 12:29 PM
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 :p

Terry



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum