Hello, I've just started re-learning HTML (I didn't get very far originally, but I've got basic experience with HTML, PHP, and MySQL, though I can't really remember squat) and I've got a beginner page here, in HTML code, that isn't displaying on my Firefox browser properly after putting it up on the web server:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://ww.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://ww.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>The First Web Page</title>
</head>

<body>
<p>
This is a test for the display of the text in the first webpage.
</p>
</body>
</html>

I put the code in php-tags because I saw that it was used on another thread.

This is the error it renders:

Parse error: syntax error, unexpected T_STRING in /home/a2217818/public_html/firstpage.html on line 1

Many thanks, I hope for a quick response

Doug

Hi Doug,

Welcome to DaniWeb! Firstly, the php-tags are unnecessary :) In the future, please indent your code, or use our Code button, to post code.

Secondly, you are most likely getting that error because of the line <?xml version="1.0" encoding="UTF-8"?>.

Try replacing that line with this:

<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.