Re: [Moderator Action] Bad code

Hi Webmaster,

This code is called the XML Declaration (defined in the XML
Recommendation [1]):

   <?xml version="1.0" encoding="UTF-8"?>

It is not PHP code and is likely to produce an error if fed to
a PHP processor as is. 

In the example you site below, it is the first part of
an XHTML document [2]; XHTML is an XML vocabulary. 

Perhaps someone has configured a Web server incorrectly and is
serving this content with a media type that suggests it is PHP.
For information about Internet media types for xhtml, please consult
[3].

I hope that helps,

 _ Ian

[1] http://www.w3.org/TR/2004/REC-xml-20040204/#NT-XMLDecl
[2] http://www.w3.org/TR/2002/REC-xhtml1-20020801/
[3]
http://www.w3.org/TR/2002/NOTE-xhtml-media-types-20020801/xhtml-media-types.html

On Sat, 2005-03-12 at 23:22 +0000, webmaster@eammm.com wrote:
> 
> Are you insane?  Look at this page
> http://www.w3.org/TR/2001/REC-xhtml11-20010531/conformance.html
> 
> Scroll to the bottom, where you'll see this:
> **********************************************************
> 
> Here is an example of an XHTML 1.1 document.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!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>Virtual Library</title>
>   </head>
>   <body>
>     <p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
>   </body>
> </html>
> 
> **************************************************************
> 
> Why are you using PHP code for line 1?
> If someone who has a page that ends in ".php" they will get an error 
> message, and their page won't display.  As that is not valid PHP syntax, 
> but you're using PHP tags.
> I put it on a page of mine, just so I could show you the message.  
> Keeping in mind that I am well aware that it would result in an error, 
> and I've quickly removed the problematic line 1 after I copied the 
> message.  (So don't ask to see the page).
> 
> ****************************
> *Parse error*: parse error, unexpected T_STRING in 
> */home/jasper/public_html/globalhead.php* on line *1*
> ****************************
> 
> Someone who is not as knowing about these sort of things, will have 
> problems because of the information on that webpage.
> Please review the webpage, and think about removing that bit of example 
> code.
> 
> And next time, think before you publish something.
> 
-- 
Ian Jacobs (ij@w3.org)   http://www.w3.org/People/Jacobs
Tel:                     +1 718 260-9447

Received on Sunday, 13 March 2005 00:51:04 UTC