Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2004-07-25, 04:48 PM
SureshM
Guest
 
Posts: n/a
Default

Hi Guys,

When I am using XML version in the XHTML, then I am getting parser error [Parse error: parse error, unexpected T_STRING on line 1].

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>Testing Page</title>
</head>
<body>


Hi</p>
</body>
</html>

When I store the above code under .php extension, I am getting parser error.

Observations:
- When I stored the same code under .htm extension, I am not getting any error.
- When I remove the version and encoding and just use <?xml?> in the first line and use .php extension, I am not getting any error.

System:
Apache/2.0.50 (Win32)
PHP Version 4.3.8 [Build Date Jul 13 2004 17:31:56]

Can you please help in understand what is going on and why parser error. I like to use the version in XML just to conform with w3c.org XHTML standards.
Reply With Quote
  #2 (permalink)  
Old 2004-07-25, 04:59 PM
Junior Member
 
Join Date: Jul 2004
Location: Lima - PerĂº
Posts: 2
Blag
Default

Quote:

When I store the above code under .php extension, I am getting parser error.
The big problem is that your mixing XML and HTML....And calling the page as a PHP script.

First.....PHP Scripts must be under <?php ?> tags.
Second....If you use the html extension....it gives you error, coz the code is not parsed.
If you just the <?XML?> as the first line....It's ok, cause your really not using any XML tag.

Greetings,

Blag h34r:
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:08 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.