很简单的一段代码,可是在IE浏览器上运行时就出现中文乱码,该怎么解决,下面是我的代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<title>创建与MySQL服务器的连接</title>
</head>
<body>
<?php
$link = mysql_connect("localhost", "root", "root") or die("不能连接到数据库服务器!可能是数据库服务器没有启动,或者用户名密码有误!".mysql_error()); //连接Mysql服务器
if($link){
echo "数据库连接成功!";
}
?>
</body>
</html>
What should I do if Chinese garbled characters appear when running PHP to connect to the MySQL server? ? Thank you very much! ! -PHP Chinese website Q&A-What should I do if Chinese garbled characters appear when running PHP to connect to the mysql server? ? Thank you very much! ! -PHP Chinese website Q&A
Please watch and learn.
可以将
改成
然后再测试下,其实现在我们都简写成:
希望对你有帮助