未声明 HTML 文档的字符编码
当我单击表单的提交按钮时,会出现以下错误消息:
未声明 HTML 文档的字符编码。在某些浏览器配置中,如果文档包含 US-ASCII 范围之外的字符,则该文档将使用乱码文本呈现。必须在文档或传输协议中声明页面的字符编码。
插入.html:
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>insert page</title></head>
<body>
<h1> Insert Page </h1>
<form action="insert.php" method="post" enctype="application/x-www-form-urlencoded" >
<p>Title:<input type="text" name="title" size="40" /></p>
<p>Price:<input type= "text" name="price" size="40" /></p>
<p><input type="submit" value="Insert" />
<input type="reset" value="Reset" /></p>
</form>
</body>
</html>
插入.php:
<?php
$title = $_POST["title"];
$price = $_POST["price"];
echo $title;
?>
我不知道我的代码中哪里有问题。请帮帮我。