當(dāng)我單擊表單的提交按鈕時(shí),將出現(xiàn)以下錯(cuò)誤消息:“未聲明HTML文檔的字符編碼。如果文檔包含US-ASCII范圍以外的字符,則在某些瀏覽器配置中,文檔將呈現(xiàn)亂碼。必須在文檔中聲明頁(yè)面的字符編碼,否則,在傳輸協(xié)議中?!眎nsert.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; ?>我不知道代碼中的問(wèn)題在哪里。請(qǐng)幫我。
未聲明HTML文檔的字符編碼
慕田峪4524236
2019-11-14 09:38:07