php代码中汉字就乱码??怎么解决???
<?php$conn=mysql_connect("localhost","root","")ordie("数据库连接错误");mysql_select_db("test...
<?php
$conn = mysql_connect("localhost","root","") or die ("数据库连接错误");
mysql_select_db("test",$conn);
mysql_query("Set Names GBK")
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>留言</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table width="1172" height="921" border="0" cellspacing="0">
<tr>
<th width="127" scope="col"> </th>
<th width="949" scope="col"> </th>
<th width="90" scope="col"> </th>
</tr>
<tr>
<td> </td>
<td><img src="images/03r.png" width="949" height="454" /></td>
<td> </td>
</tr>
<tr>
<td height="329"> </td>
<td align="center" valign="top" background="images/03bb.png"><p><img src="images/qq.jpg" width="922" height="145" border="0" usemap="#Map" /></p>
<hr />
<table width="500" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?php
$sql="select * from message";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td> 用户:<?php echo $row["user"];?> 标题:<?php echo $row["title"];?> </td>
</tr>
<tr bgcolor="#ffffff">
<td>内容:<?php echo $row["content"];?> </td>
</tr>
<?php
}
?>
</table>
<p> </p>
<p> </p>
<p> </p>
<p><img src="images/vb.jpg" width="924" height="44"></p>
<tr>
<td height="31"> </td>
</tr>
<td></td>
</table>
</tr>
<tr>
<td>
</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<map name="Map"><area shape="rect" coords="445,121,543,146" href="add.php">
<area shape="rect" coords="14,24,75,44" href="admin/list.php">
</map></body>
</html> 展开
$conn = mysql_connect("localhost","root","") or die ("数据库连接错误");
mysql_select_db("test",$conn);
mysql_query("Set Names GBK")
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>留言</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table width="1172" height="921" border="0" cellspacing="0">
<tr>
<th width="127" scope="col"> </th>
<th width="949" scope="col"> </th>
<th width="90" scope="col"> </th>
</tr>
<tr>
<td> </td>
<td><img src="images/03r.png" width="949" height="454" /></td>
<td> </td>
</tr>
<tr>
<td height="329"> </td>
<td align="center" valign="top" background="images/03bb.png"><p><img src="images/qq.jpg" width="922" height="145" border="0" usemap="#Map" /></p>
<hr />
<table width="500" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?php
$sql="select * from message";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td> 用户:<?php echo $row["user"];?> 标题:<?php echo $row["title"];?> </td>
</tr>
<tr bgcolor="#ffffff">
<td>内容:<?php echo $row["content"];?> </td>
</tr>
<?php
}
?>
</table>
<p> </p>
<p> </p>
<p> </p>
<p><img src="images/vb.jpg" width="924" height="44"></p>
<tr>
<td height="31"> </td>
</tr>
<td></td>
</table>
</tr>
<tr>
<td>
</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<map name="Map"><area shape="rect" coords="445,121,543,146" href="add.php">
<area shape="rect" coords="14,24,75,44" href="admin/list.php">
</map></body>
</html> 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询