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

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

<title>The First Web Page</title>

This is a test for the display of the text in the first webpage.

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


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"?>'; ?>