| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 800 人关注过本帖
标题:asp出现乱码,求助
只看楼主 加入收藏
cengin
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-1-12
结帖率:0
收藏
已结贴  问题点数:20 回复次数:5 
asp出现乱码,求助
<!--#Include File="../Comm/Netsys_Conn_Main.asp"-->
<!--#include file="../HtmlEdit/FCKeditor/fckeditor.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Netsys网站管理系统</title>
<link href="../Style/Css.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
function Check()
{
  if (document.MyForm.NTitle.value=="")
  {
      alert("有*号的必须填写!");
      document.MyForm.NTitle.focus()
      return false
   }
  if (document.MyForm.ClassID.value=="")
  {
      alert("有*号的必须填写!");
      document.MyForm.ClassID.focus()
      return false
   }
  if (document.MyForm.NViews.value=="")
  {
      alert("有*号的必须填写!");
      document.MyForm.NViews.focus()
      return false
   }
}
</script>
</head>
<body>
<%
If Request("Add")="OK" Then
   
    NTitle                =    DelStr(Request("NTitle"))
    NAuthor                =    DelStr(Request("NAuthor"))
    NSource                =    DelStr(Request("NSource"))
    ClassID                =    DelStr(Request("ClassID"))
    NContent            =    Request("NContent")
   
    '获取排序
    set rsa=server.createobject("adodb.recordset")
    rsa.open"select top 1 * from Netsys_News_Cn order by NOrder desc",conn,1,1
    if not rsa.eof then
      NOrder=rsa("NOrder")+1
    else
      NOrder=1
    end if
    rsa.close
    set rsa=nothing
   
    NViews                =    Request("NViews")
    NHome                =    Request("NHome")
   
    Set Rsa=server.createobject("ADODB.RecordSet")
    Sqla="Select * From Netsys_News_Cn"
    Rsa.open Sqla,conn,1,3
    Rsa.addnew
        Rsa("NTitle")            =    NTitle
        Rsa("NAuthor")            =    NAuthor
        Rsa("NSource")            =    NSource
        Rsa("ClassID")            =    ClassID
        Rsa("NContent")            =    NContent
        Rsa("NOrder")            =    NOrder
        Rsa("NViews")            =    NViews

        If NHome=1 Then
          Rsa("NHome")           =   1
        Else
          Rsa("NHome")           =   0
        End If

    Rsa.update
    Rsa.Close
    Set Rsa=nothing
    Response.Write "<script>"
    Response.Write "alert('您输入的信息已经发布成功!');"
    Response.Write "location.href='Netsys_List.asp';"
    Response.Write "</script>"
End If
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="10"></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="right_tittle">
  <tr>
    <td width="3"><img src="../images/r1.jpg" width="10" height="33" /></td>
    <td><img src="../images/current.jpg" width="9" height="9" /> 当前位置 &gt;&gt; 新闻管理 | 发布新闻信息</td>
    <td width="10" align="right"><img src="../images/r3.jpg" width="10" height="33" /></td>
  </tr>
</table>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="2" class="right_con">
    <tr>
      <td height="490" align="center" valign="top" bgcolor="#FFFFFF">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"></td>
        </tr>
      </table>
      <br />
        <form name="MyForm" action="" method="post">
        <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CDD8DF" class="table_all" >
          <tr>
            <td width="19%" align="left" class="Left_td">标题:</td>
            <td width="81%" align="left" class="Right_td">
            <input name="NTitle" type="text" id="NTitle" style="width:300px" value="">
            <font color="#ff0000">*</font>
            </td>
          </tr>
          <tr>
            <td align="left" class="Left_td">作者:</td>
            <td align="left" class="Right_td"><input name="NAuthor" type="text" id="NAuthor" style="width:300px" value=""></td>
          </tr>
          <tr>
            <td align="left" class="Left_td">来源:</td>
            <td align="left" class="Right_td"><input name="NSource" type="text" id="NSource" style="width:300px" value=""></td>
          </tr>
          <tr>
            <td align="left" class="Left_td">类型:</td>
            <td align="left" class="Right_td">
              <select name="ClassID" id="ClassID">
                  <option value="">请选择类型</option>
                  <%
                    Set Rst=server.createobject("adodb.recordset")
                    Rst.open "Select * From Netsys_News_Class_Cn Order By ClassOrder Asc",Conn,1,1
                    If Not Rst.eof and Not Rst.bof Then
                    Do While Not Rst.eof
                  %>
                  <option value="<%=Rst("ClassID")%>"><%=Rst("ClassName")%></option>
                  <%
                    Rst.movenext
                    Loop
                    End If
                    Rst.Close
                    Set Rst=nothing
                  %>
              </select>
            <font color="#ff0000">*</font></td>
          </tr>
          <tr>
            <td align="left" class="Left_td">详细:</td>
            <td align="left" class="Right_td">
            <%
                Dim oFCKeditor
                Set oFCKeditor = New FCKeditor
                oFCKeditor.BasePath = "../HtmlEdit/FCKeditor/"
               
                oFCKeditor.ToolbarSet = "Default"
                oFCKeditor.Width = "100%"
                oFCKeditor.Height = "380px"
               
                oFCKeditor.Value = ""
                oFCKeditor.Create "NContent"
            %>
            </td>
          </tr>
          <tr>
            <td align="left" class="Left_td">点击率:</td>
            <td align="left" class="Right_td"><input name="NViews" type="text" id="NViews" style="width:300px" value="1" onKeyUp="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
            <font color="#ff0000">*</font></td>
          </tr>
          <tr>
            <td align="left" class="Left_td">特殊标记:</td>
            <td align="left" class="Right_td">
            <input name="NHome" type="checkbox" id="NHome" value="1" style="border:none;" />
            首页推荐
            </td>
          </tr>
          <tr>
            <td align="left" class="Left_td">&nbsp;</td>
            <td align="left" class="Right_td">
              <input name="submit" type="submit" onClick="return Check();" value=" 确认提交 " class="button">&nbsp;&nbsp;&nbsp;&nbsp;
                <input name="reset" type="reset" value=" 重新填写 " class="button">&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="hidden" name="Add" value="OK">
            </td>
          </tr>
        </table>
        </form>
      </td>
    </tr>
</table>
</body>
</html>
搜索更多相关主题的帖子: html css function document content 
2012-01-12 11:36
cengin
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-1-12
收藏
得分:0 
在dreamweaver没发现问题,
浏览显示
图片附件: 游客没有浏览图片的权限,请 登录注册


[ 本帖最后由 cengin 于 2012-1-12 11:43 编辑 ]
2012-01-12 11:40
潘明锋
Rank: 2
等 级:论坛游民
帖 子:1
专家分:10
注 册:2012-1-12
收藏
得分:10 
哎,这个简单!编码不一致,如果一样,修改下二进制编码!
2012-01-12 11:55
cengin
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-1-12
收藏
得分:0 
编码改了还是不行,encoding="utf-8,这个代码是什么意思
2012-01-12 12:43
cengin
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-1-12
收藏
得分:0 
有的页面可以显示中文
2012-01-12 12:44
jswenda
Rank: 2
等 级:论坛游民
帖 子:2
专家分:15
注 册:2012-1-16
收藏
得分:10 
编码不一致,不是改utf-8为gb2312就可以的,要在DW里刷新过,内部编码才会调整过来,有问题可以上93问答看看。
http://www.


[ 本帖最后由 jswenda 于 2012-1-16 22:56 编辑 ]
2012-01-16 22:50
快速回复:asp出现乱码,求助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019706 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved