www.brinkster.com网站空间,为什么往数据库增加东西后,显示的是乱码???
这个问题一直解决不了!!
例如我发表留言,可以发表,但是显示出来的是乱码!
可以看这个页面效果就知道问题了!http://auto0605.brinkster.net/message/showmessage.asp
第一二条是我直接写到数据库的文字,后面的乱码则是我新增留言后显示的
谁用过这个空间?知道的说声,实在没辙了
或者提点建议也可以!
非常感谢啊!!
问题点数:20、回复次数:2Top
1 楼yxxue(云啸雪)回复于 2006-12-01 16:49:50 得分 0
我没看那个网站,如果是国外的空间,数据库可能是英文版的,不支持以GB2312写入中文
这要确认数据库的编码格式才能统一,或者用UTF-8写入试试.Top
2 楼mugua000()回复于 2006-12-01 17:16:08 得分 0
谢谢你的回答!
我改成UTF-8后,在后台查看网页原代码时发现中文可以看到了!原来用GB2312时原代码中的中文都是乱码!
不过我插入记录的网页改成utf-8格式后,且显示网页部分也改成了utf-8格式,但是显示的还是乱码!我的插入记录网页代码如下:
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加留言</title>
<%
if request.Form("name")="" or len(trim(request.Form("name")))>40then
Response.write"<script>alert(""姓名不能为空或超过20字!"");location.href=""javascript:history.go(-1)"";</script>"
Response.end()
end if
if request.Form("title")=""or len(trim(request.Form("title")))>120 then
Response.write"<script>alert(""留言标题不能为空或超过60字!"");location.href=""javascript:history.go(-1)"";</script>"
Response.end()
end if
if request.Form("ctent")="" or len(trim(request.Form("ctent")))>500 then
Response.write"<script>alert(""留言内容不能为空或超过250字!"");location.href=""javascript:history.go(-1)"";</script>"
Response.end()
end if
if request.Form("email")="" or InStr(2,request.Form("email"),"@")=0 then
Response.write"<script>alert(""Email有问题请重新填写!"");location.href=""javascript:history.go(-1)"";</script>"
Response.end()
end if
dsql="select * from message where id is null"
set rs=server.createobject("adodb.recordset")
rs.open dsql,conn,1,3
rs.addnew
rs("name")=request.Form("name")
rs("qq")=request.Form("qq")
rs("email")=request.Form("email")
rs("homepage")=request.Form("homepage")
rs("title")=request.Form("title")
rs("ctent")=request.Form("ctent")
rs("icon")=request.Form("tw")
rs.update
rs.close
set rs=nothing
response.write "<script> alert('恭喜你留言成功,点确定查看留言!');location.replace('showmessage.asp');</script>"
response.end
%>
</head>
<body>
</body>
</html>
你看这段插入代码应该没问题吧,麻烦你了!
大侠们,帮我下吧!Top





