0

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

Edited by mike_2000_17: Fixed formatting

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Dani
0

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

Edited by mike_2000_17: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.