急急急,php中post提交中文乱码!!
表单提交方式是post,提交text后中文总是乱码,不要告诉我设置heard()函数以及标签meta为utf-8,这两个都设置为了uft-8,可还是乱码,php-in中d...
表单提交方式是post,提交text后中文总是乱码,不要告诉我设置heard()函数以及标签meta为utf-8,这两个都设置为了uft-8,可还是乱码,php-in中default-charset也设置了utf-8,可还是乱码这是代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
</title>
</head>
<body>
<form action="ceshi.php" method = "post" enctype="multipart/form-data" >
<p>
name:<br/>
<input type="text" id="name" name="name" size = "20" maxlength= "40" />
</p>
<p>
Email:<br/>
<input type="text" id = "email" name="email" size="20" maxlength="40" />
</p>
<p>
<input type = "submit" id ="submit" name="submit" value="Go!" />
</p>
</form>
</body>
</html>
ceshi.php是:
<?php
header("Content-type: text/html; charset=utf-8");
if(isset($_POST['name'])){
$name = htmlentities($_POST['name']);
$email = htmlentities($_POST['email']);
printf("Hi %s! <br/>",$name);
printf("The address %s will soon be a spam-magnet!<br/>",$email);
}
?>求解决,万分感谢!!!! 展开
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
</title>
</head>
<body>
<form action="ceshi.php" method = "post" enctype="multipart/form-data" >
<p>
name:<br/>
<input type="text" id="name" name="name" size = "20" maxlength= "40" />
</p>
<p>
Email:<br/>
<input type="text" id = "email" name="email" size="20" maxlength="40" />
</p>
<p>
<input type = "submit" id ="submit" name="submit" value="Go!" />
</p>
</form>
</body>
</html>
ceshi.php是:
<?php
header("Content-type: text/html; charset=utf-8");
if(isset($_POST['name'])){
$name = htmlentities($_POST['name']);
$email = htmlentities($_POST['email']);
printf("Hi %s! <br/>",$name);
printf("The address %s will soon be a spam-magnet!<br/>",$email);
}
?>求解决,万分感谢!!!! 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询