|
0鱼币
先输入用户名,后输出就出现乱码了,
为什么,怎么解决,谢谢大家
<form action = "2.php">
用户名: <input type = "text" name = "userName"/> <br/>
密 码:<input type = "password" name = "password"/> <br/>
确认密码:<input type = "password" name = "confirmPassword"/> <br/>
<input type = "submit" value = " 提 交 "/>
<input type = "reset" value = " 重 填 "/>
</form>
<?php
header('Content-Type:text/html; charset=utf-8;');
$userName = $_GET["userName"];
$password = $_GET["password"];
$confirmPassword = $_GET["confirmPassword"];
echo "用户:",$userName;
echo "<br/>";
echo "密码:",$password;
echo "<br/>";
echo "确认密码:",$confirmPassword;
echo "<br/>";
?>
你不可能要求别人的浏览器是utf-8编码,所以你需要自己声明,我很奇怪你为嘛要把那段代码注释起来(别问我哪段,你截图上就注释了一段代码)?
|
|