21,886
社区成员
发帖
与我相关
我的任务
分享
<?php header('Content-Type:text/html;charset=utf-8'); ?>
这么设置还是错了include('../class/mysql_class#.php');
在这里面已经设置了编码function mysql_link(){ //建立连接
global $mysql__host,$mysql__user,$mysql__pass,$mysql__db;
$link = @mysql_connect($mysql__host,$mysql__user,$mysql__pass) or die ('连接MYSQL服务器出错');
mysql_query("SET NAMES utf8 ");
//mysql_query("SET character_set_client='utf8'");
//mysql_query("SET CHARACTER SET utf8");
//mysql_query("SET CHARACTER_SET_RESULTS=utf8");
@mysql_select_db($mysql__db,$link) or die ('连接MYSQL数据库出错');
return $link;
}
可是还是出乱码了?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>提交成功,感谢你的支持</title>
</head>
<body>
<?php
if($DB->query($sql))
{
echo "<script>alert('提交成功,感谢你的支持');window.location.href='solictopic.php'</script>";
}
$DB->close();
?>
</body>
</html>