1

This is the HTML body of the PHP page I'm trying to create.

<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="utf-8" http-equiv="encoding" />
</head>
<body>
<?php

echo <<< _END
<form action="create_strike.php" method="post">
<pre>
Device ID: <input type="text" name="device_id" />
Latitude: <input type="text" name="latitude" />
Longitude: <input type="text" name="longitude" />
<input type="submit" value="Create Strike!" />
</pre>
</form>
_END;
?>
</body>
</html>

I'm still getting the error "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol."

As you can see, I have added the headers as suggested by this thread and this other thread. But still no use. Could someone tell me what I'm doing wrong?

Community
  • 1
  • 1
reybenher
  • 11
  • 1
  • 3
  • You have a `meta` tag outside of the `head` and in your head you are missing the `title`. Where does the error come from? – jeroen May 21 '14 at 00:33
  • Show the HTML code as received by a browser (or by a validator), e.g. using View Source. The document is malformed (the first `meta` tag should be moved after the `` tag, and the two other `meta` tags are redundant, and the latter of them in error, and the `title` element is missing. But these errors do *not* trigger the error message quoted in the question (presumably, quoted from a browser console log). – Jukka K. Korpela May 21 '14 at 06:13
  • Thank you for the replies. It was a silly mistake though! The filename was .html and not .php – reybenher May 25 '14 at 09:26

0 Answers0