跟着PHP视频写了一段乱码,MYSQL数据库乱码是搞定了,但是用EPP调试时,显示的中文是乱码(我文件等都用UTF8),如果用火狐浏览器只要设置UTF-8即可,但是EPP调试时不知道哪里设置
<?
$conn=@mysql_connect("localhost","root","") or die("连接错误");
mysql_select_db("test",$conn);if($_POST['submit']){
mysql_query("set names utf8");
$sql="insert into message (id,user,title,content,lastdate) ".
"values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
mysql_query($sql,$conn);
}
?>
<form action="add.php" method="post">
用户:<input type="text" size="10" name="user"/><br/>
标题:<input type="text" name="title"/><br/>
内容:<textarea name="content"></textarea><br/>
<input type="submit" name="submit" value="发布留言"/></form>其中“用户”,“标题”,“内容”用EPP调试时都是乱码
<?
$conn=@mysql_connect("localhost","root","") or die("连接错误");
mysql_select_db("test",$conn);if($_POST['submit']){
mysql_query("set names utf8");
$sql="insert into message (id,user,title,content,lastdate) ".
"values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
mysql_query($sql,$conn);
}
?>
<form action="add.php" method="post">
用户:<input type="text" size="10" name="user"/><br/>
标题:<input type="text" name="title"/><br/>
内容:<textarea name="content"></textarea><br/>
<input type="submit" name="submit" value="发布留言"/></form>其中“用户”,“标题”,“内容”用EPP调试时都是乱码
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货