为了账号安全,请及时绑定邮箱和手机立即绑定

未声明HTML文档的字符编码

未声明HTML文档的字符编码

慕田峪4524236 2019-11-14 09:38:07
当我单击表单的提交按钮时,将出现以下错误消息:“未声明HTML文档的字符编码。如果文档包含US-ASCII范围以外的字符,则在某些浏览器配置中,文档将呈现乱码。必须在文档中声明页面的字符编码,否则,在传输协议中。”insert.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>insert.php:<?php   $title = $_POST["title"];   $price = $_POST["price"];  echo $title; ?>我不知道代码中的问题在哪里。请帮我。
查看完整描述

3 回答

?
弑天下

TA贡献1818条经验 获得超7个赞

将其作为第一行添加到HTML模板的HEAD部分中


<meta content="text/html;charset=utf-8" http-equiv="Content-Type">

<meta content="utf-8" http-equiv="encoding">


查看完整回答
反对 回复 2019-11-14
  • 3 回答
  • 0 关注
  • 900 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信