CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
(图)邪恶的韩国UMPC 使用 Java 编写数据库应用新规范
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

www.brinkster.com网站空间,为什么往数据库增加东西后,显示的是乱码???

楼主mugua000()2006-12-01 13:39:44 在 Web 开发 / ASP 提问

这个问题一直解决不了!!    
  例如我发表留言,可以发表,但是显示出来的是乱码!    
  可以看这个页面效果就知道问题了!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

相关问题

关键词

得分解答快速导航

  • 帖主:mugua000

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
惹火投票。。火热进行中...
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo