| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 944 人关注过本帖
标题:新手的困扰,源码加入一此些代码后就不行了。请高手帮忙,谢谢!
只看楼主 加入收藏
znmw
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2011-3-6
收藏
 问题点数:0 回复次数:2 
新手的困扰,源码加入一此些代码后就不行了。请高手帮忙,谢谢!
各位高手你好,首先感谢你能进这贴。如果你知道的话请解答我一下,谢谢!

问题:就是以下代码我加入了红色字体那些代码后,就出现了点添加或修改后没有添加成功或修改成功出来了(在没加这些代码是可以的),去看数据库也没有添加或修改过,当然我的数据库也加了这些代码的数据项目的,就是不行。
现在请问高手,这是怎么回事?要怎样才能解决这个问题?谢谢!

<!--#include file="../Inc/conn.asp"-->
<!--#include file="../Inc/saveimage.asp"-->
<!--#include file="../Inc/Function_Page.asp"-->
<!--#include file="Admin_check.asp"--><html xmlns="http://www.
<head><meta http-equtv="Content-Type" content="text/html; charset=gb2312" />
<title>网站后台管理</title><link href="images/Admin_css.css" type=text/css rel=stylesheet>
<link rel="shortcut icon" href="<%=SitePath%>images/myfav.ico" type="image/x-icon" />
<script src="js/admin.js"></script>
<script language="JavaScript" src="../js/Jquery.js"></script>
<script charset="utf-8" src="../KindEditor/kindeditor.js"></script>
<script>
        KE.show({
                id : 'Content',
                autoSetDataMode: false,
                afterCreate : function(id) {
                    KE.event.add(KE.$('myform'), 'submit', function() {
                        KE.sync(id);
                    });
                },
                minWidth : 500,minHeight:300,allowUpload:false,
                items:[ 'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
'italic', 'underline', 'strikethrough', 'removeformat','|','justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', '|', 'selectall', '-','undo', 'redo', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|','image','flash', 'media', 'advtable', 'hr', 'emoticons', 'specialchar', 'link', 'unlink', '|','source', 'fullscreen', 'about', 'preview']
        });
</script>
</head>

<body>
<script language=javascript>
function CheckForm()
{
  if (document.myform.Title.value==""){
    alert("请填写标题!");
    document.myform.Title.focus();
    return false;
  }
  if (document.myform.ClassID.value==""){
    alert("请选择分类!");
    document.myform.ClassID.focus();
    return false;
  }
  if (document.myform.Hits.value==""){
    alert("请填写浏览次数!");
    document.myform.Hits.focus();
    return false;
  }
  var filter=/^\s*[0-9]{1,6}\s*$/;
  if (!filter.test(document.myform.Hits.value)) {
    alert("浏览次数填写不正确,请重新填写!");
    document.myform.Hits.focus();
    return false;
  }
}
            function ResumeError()
            {return true;}
            window.onerror = ResumeError;
            $(document).ready(function(){
                $(parent.frames["main"].document).find("#Button1").attr("disabled",false);
              $('#KeyLinkByTitle').click(function(){
                GetKeyTags();
              });
            });
            function GetKeyTags()
            {
              var text=escape($('input[name=Title]').val());
              if (text!=''){
                  $('#KeyWord').val('稍等,138正在自动获取...');
                  $("#KeyWord").attr("disabled",true);
                  $.get("ajaxs.asp", { action: "GetTags", text: text,maxlen: 20 },
                  function(data){
                    $('#KeyWord').val(unescape(data));
                    $('#KeyWord').attr("disabled",false);
                  });
              }else{
               alert('请先输入标题!');
              }
            }
</script>
<table width="95%" border="0" cellspacing="2" cellpadding="3"  align=center class="admintable" style="margin-bottom:5px;">
    <tr><form name="form1" method="get" action="Admin_Down.asp?page=<%=page%>">
      <td height="25" bgcolor="f7f7f7">快速查找:
        <SELECT onChange="javascript:window.open(this.options[this.selectedIndex].value,'main')"  size="1" name="s">
        <OPTION value="" selected>-=请选择=-</OPTION>
        <OPTION value="?s=all">所有软件</OPTION>
        <OPTION value="?s=yn0">已审的软件</OPTION>
        <OPTION value="?s=yn1">未审的软件</OPTION>
        <OPTION value="?s=yn2">会员私有软件</OPTION>
          <OPTION value="?s=istop">固顶软件</OPTION>
        <OPTION value="?s=ishot">推荐软件</OPTION>
        <OPTION value="?s=img">有缩略图软件</OPTION>
        <OPTION value="?s=url">转向链接软件</OPTION>
        <OPTION value="?s=user">会员发表的软件</OPTION>
        <OPTION value="?hits=1">按浏览次数排序</OPTION>
      </SELECT>      </td>
      <td align="center" bgcolor="f7f7f7">
        <a href="?hits=1"></a>
        <input name="keyword" type="text" id="keyword" value="<%=request("keyword")%>" class="s26">
        <input type="submit" name="Submit2" class="bnt" value="搜索">
      </form></td>
      <td align="right" bgcolor="f7f7f7">跳转到:
        <select name="DownClassID" id="ClassID" onChange="javascript:window.open(this.options[this.selectedIndex].value,'main')">
    <%
   Dim Sqlp,Rsp,TempStr
   Sqlp ="select * from "&tbname&"_DownClass Where TopID = 0 and link=0 order by num"   
   Set Rsp=server.CreateObject("adodb.recordset")   
   rsp.open sqlp,conn,1,1
   Response.Write("<option value="""">请选择分类</option>")
   If Rsp.Eof and Rsp.Bof Then
      Response.Write("<option value="""">请先添加分类</option>")
   Else
      Do while not Rsp.Eof   
         Response.Write("<option value=" & """?DownClassID=" & Rsp("ID") & """" & "")
         If int(request("DownClassID"))=Rsp("ID") then
                Response.Write(" selected" )
         End if
         Response.Write(">|-" & Rsp("ClassName") & " ("&Mydb("Select Count([ID]) From ["&tbname&"_Down] Where ClassID="&rsp("ID")&"",1)(0)&")</option>")  & VbCrLf
         
            Sqlpp ="select * from "&tbname&"_DownClass Where TopID="&Rsp("ID")&" and link=0 order by num"   
               Set Rspp=server.CreateObject("adodb.recordset")   
               rspp.open sqlpp,conn,1,1
            Do while not Rspp.Eof
                Response.Write("<option value=" & """?ClassID=" & Rspp("ID") & """" & "")
                If int(request("ClassID"))=Rspp("ID") then
                Response.Write(" selected" )
                End if
                 Response.Write("> |-" & Rspp("ClassName") & " ("&Mydb("Select Count([ID]) From ["&tbname&"_Down] Where ClassID="&rspp("ID")&"",1)(0)&")")
                Response.Write("</option>" )   & VbCrLf
            Rspp.Movenext   
              Loop
            rspp.close
            set rspp=nothing
      Rsp.Movenext   
      Loop   
   End if
    rsp.close
    set rsp=nothing
    %>
        </select></td>
    </tr>
</table>
<%
    if request("action") = "add" then
        call add()
    elseif request("action")="edit" then
        call edit()
    elseif request("action")="savenew" then
        call savenew()
    elseif request("action")="savedit" then
        call savedit()
    elseif request("action")="yn1" then
        call yn1()
    elseif request("action")="yn2" then
        call yn2()
    elseif request("action")="del" then
        call del()
    elseif request("action")="delAll" then
        call delAll()
    else
        call List()
    end if

sub List()
%>
<form name="myform" id="myform" method="POST" action="Admin_Down.asp?action=delAll">
<table width="95%" border="0"  align=center cellpadding="3" cellspacing="1" bgcolor="#F2F9E8" class="admintable">
<tr>
  <td colspan="5" align=left class="admintitle">下载列表 [<a href="?action=add">添加</a>]</td></tr>
    <tr bgcolor="#f1f3f5" style="font-weight:bold;">
    <td width="5%" height="30" align="center" class="ButtonList">&nbsp;</td>
    <td width="53%" align="center" class="ButtonList">软件名称</td>
    <td width="20%" height="25" align="center" class="ButtonList">发布时间</td>
    <td width="7%" height="25" align="center" class="ButtonList">浏览</td>
    <td width="15%" height="25" align="center" class="ButtonList">管理</td>   
    </tr>
<%
Hits=request("hits")
s=Request("s")
Downclass=request("ClassID")
keyword=request("keyword")
Set mypage=new xdownpage
mypage.getconn=conn
mysql="select ID,Title,Author,ClassID,DateAndTime,Hits,Yn,IsTop,IsHot,IsFlash,Images,UserID,UserName from "&tbname&"_Down Where"
If yaoadmintype<>1 then
    If yaoManagePower<>"" then
    mysql=mysql&" (ClassID in ("&yaoManagePower&") or UserName = '"&Session("YaoAdmin")&"')"
    Else
    mysql=mysql&" UserName = '"&Session("YaoAdmin")&"'"
    End if
Else
    mysql=mysql&" yn<>3"
End if

    if s="yn0" then
    mysql=mysql&" And yn=0"
    elseif s="yn1" then
    mysql=mysql&" And yn=1"
    elseif s="yn2" then
    mysql=mysql&" And yn=2"
    elseif s="istop" then
    mysql=mysql&" And istop=1"
    elseif s="ishot" then
    mysql=mysql&" And ishot=1"
    elseif s="img" then
    mysql=mysql&" And images<>''"
    elseif s="url" then
    mysql=mysql&" And LinkUrl<>''"
    elseif s="user" then
    mysql=mysql&" And UserID<>0"
    elseif Downclass<>"" then
    mysql=mysql&" And ClassID="&Downclass&""
    elseif keyword<>"" then
    mysql=mysql&" And Title like '%"&keyword&"%'"
    End if
mysql=mysql&" order by "
If Hits=1 then
mysql=mysql&"Hits desc"
Else
mysql=mysql&"DateAndTime desc"
End if
mypage.getsql=mysql
mypage.pagesize=15
set rs=mypage.getrs()
for i=1 to mypage.pagesize
    if not rs.eof then
%>
    <tr bgcolor="#ffffff" onMouseOver="this.style.backgroundColor='#EAFCD5';" onMouseOut="this.style.backgroundColor='';this.style.color=''">
    <td height="25" align="CENTER"><input type="checkbox" value="<%=rs(0)%>" name="ID" onClick="unselectall(this.form)" style="border:0;"></td>
    <td height="25">[<a href="?ClassID=<%=rs(3)%>"><%=Downlist(rs(3))%></a>]<a href="<%=SitePath%><%If html=1 then Response.Write("Down.asp?ID="&rs(0)&"") else Response.Write("Down/?"&rs(0)&".html") End if%>" target="_blank"><%=rs(1)%></a> <%if rs(7)=1 then Response.Write("<font color=red>[顶]</font>") end if%><%if rs(8)=1 then Response.Write("<font color=green>[荐]</font>") end if%><%if rs(10)<>"" then Response.Write("<font color=blue>[图]</font>") end if%><%if rs(9)=1 then Response.Write("<font color=orange>[幻]</font>") end if%><%If rs(11)<>0 then Response.Write(" <font color=blue>["&rs(12)&"]</font>") end if%></td>
    <td height="25" align="center"><%=rs(4)%></td>
    <td height="25" align="center"><%=rs(5)%></td>
    <td align="center"><%If rs(6)=0 then Response.Write("已审") end if:If rs(6)=1 then Response.Write("<font color=red>未审</font>") end if:If rs(6)=2 then Response.Write("<font color=blue>私有</font>") end if%>|<a href="?action=edit&id=<%=rs(0)%>&page=<%=page%>">编辑</a>|<%If Mydb("Select Count([ID]) From ["&tbname&"_Pl] Where ArticleID="&rs(0)&"",1)(0)>0 Then Response.Write("<a href=""Admin_pl.asp?id="&rs(0)&""">评论</a>") else Response.Write("<a href=""#""><font style='color:#ccc;'>评论</font></a>") End if%></td>   
    </tr>
<%
        rs.movenext
    else
         exit for
    end if
next
%>
<tr><td align="center" bgcolor="f7f7f7"><input name="Action" type="hidden"  value="Del"><input name="chkAll" type="checkbox" id="chkAll" onClick=CheckAll(this.form) value="checkbox" style="border:0"></td>
  <td colspan="4" bgcolor="f7f7f7"><font color=red>移动到:</font>
    <select id="ytype" name="ytype">
      <%call Admin_ShowClass_Option()%>
    </select>
    &nbsp;
    <input name="Del" type="submit" class="bnt" id="Del" value="移动">
    <input name="Del" type="submit" class="bnt" id="Del" value="更新时间">
    <input name="Del" type="submit" class="bnt" id="Del" value="删除">
    <input name="Del" type="submit" class="bnt" id="Del" value="批量未审">
    <input name="Del" type="submit" class="bnt" id="Del" value="批量审核">
    <input name="Del" type="submit" class="bnt" id="Del" value="推荐">
    <input name="Del" type="submit" class="bnt" id="Del" value="解除推荐">
    <input name="Del" type="submit" class="bnt" id="Del" value="固顶">
    <input name="Del" type="submit" class="bnt" id="Del" value="解除固顶"></td>
  </tr><tr><td bgcolor="f7f7f7" colspan="5">
<div id="page">
    <ul style="text-align:left;">
    <%=mypage.showpage()%>
    </ul>
</div>
</td></tr></table>
</form>
<%
    rs.close
    set rs=nothing
end sub

sub add()
%>
<table width="95%" border="0"  align=center cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" class="admintable">
<form onSubmit="return CheckForm();" action="?action=savenew" id="myform" name="myform" method=post>
<tr>
    <td colspan="2" align=left class="admintitle">添加下载</td></tr>
<tr>
<td width="20%" class="b1_1">标题</td>
<td class="b1_1"><input name="Title" type="text" id="Title" size="40" maxlength="50" onBlur="CheckName();" onChange="CheckName();">
        <input name="TitleFontColor" type="hidden" id="TitleFontColor" onClick="Getcolor(ColorBG,'TitleFontColor');" Readonly>
      <img border=0 src="../images/Rect.gif" style="cursor:pointer;" onClick="Getcolor(this,'TitleFontColor');" title="选取标题颜色" align="absmiddle" ID="ColorBG">&nbsp;<span class="note">注:最多50个字符</span></td>
</tr>
<tr>
  <td class="b1_1">关键字【<a href="#" id="KeyLinkByTitle" style="color:green">根据标题自动获取</a>】</td>
  <td class="b1_1"><input name="KeyWord" type="text" id="KeyWord" size="40" maxlength="50">&nbsp;<span class="note">多个关键字用|隔开</span></td>
</tr>
<tr>
  <td class="b1_1">授权方式</td>
  <td class="b1_1"><input name="ShouQuan" type="text" id="ShouQuan" value="" size="40" maxlength="200"><span class="note"> 填写如:免费程序,收费程序,共享软件,插件补丁,等</span></td></tr>
<tr>
  <td class="b1_1">界面语言</td>
  <td class="b1_1">
    <input name="YiYan" type="text" id="YiYan" value="" size="40" maxlength="200"><span class="note"> 填写如:简体中文,繁体中文,英文程序,中英文,日语,等</span></td>
 </tr>

<tr>
  <td class="b1_1">软件大小</td>
  <td class="b1_1">
    <input name="Author" type="text" id="Author" value="  KB" size="40" maxlength="200"><span class="note"> 请填写为多少MB或多少KB,注:1024kb=1MB,不要写错了哦</span></td>
 </tr>
<tr>
  <td class="b1_1">推荐等级</td>
  <td class="b1_1"><input name="LeiXing" type="text" id="LeiXing" value="★★★☆☆" size="40" maxlength="200"><span class="note"> 如:★☆☆☆☆,★★☆☆☆,★★★☆☆,★★★★☆,★★★★★</span></td>
 </tr>
<tr>
  <td class="b1_1">资源格式</td>
  <td class="b1_1"><input name="GeShi" type="text" id="GeShi" value="" size="40" maxlength="200"><span class="note"> 如:exe,rar,zip,iso,其它</span></td>
 </tr>
<tr>
  <td class="b1_1">平台环境</td>
  <td class="b1_1">
    <input name="HuanJing" type="text" id="HuanJing" value="" size="40" maxlength="200"><span class="note"> 填写如:Win2003,WinXP,Win2000,Win9X,asp+Access,asp+mssql,php+mysql等</span></td>
 </tr>

<tr>
  <td class="b1_1">演示地址</td>
  <td class="b1_1"><span class="td">
    <input name="CopyFrom" type="text" id="CopyFrom" value="http://" size="40" maxlength="200">
  </span></td>
</tr>
<tr>
  <td class="b1_1">分类</td>
  <td class="b1_1"><select ID="ClassID" name="ClassID">
    <%call Admin_ShowClass_Option()%></select>&nbsp;<span class="note">如果有二级分类,请选择二级分类.</span></td>
</tr>
<tr>
  <td class="b1_1">转向链接</td>
  <td class="b1_1"><input name="LinkUrl" type="text" size="50" disabled>
          <INPUT name="UseLinkUrl" type="checkbox" class="noborder" id="UseLinkUrl" onClick="if(this.checked){
              LinkUrl.disabled = false;
          }else{
              LinkUrl.disabled = true;
          }" value="Yes">
      使用转向链接        </td>
</tr>
<tr>
  <td class="b1_1">浏览次数</td>
  <td class="b1_1"><input name="Hits" type="text" id="Hits" value="0" size="6" maxlength="10"></td>
</tr>
<tr>
  <td rowspan="2" class="b1_1">缩略图</td>
  <td class="b1_1"><input name="Images" type="text" id="Images" size="50" maxlength="200"></td>
</tr>
<tr>
  <td class="b1_1"><iframe src="upload.asp?action=simg" width="400" height="25" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
  <td class="b1_1">下载摘要<br><span class="note">不填写则自动截取正文开始部分字符</span></td>
  <td class="b1_1"><textarea name="ArtDescription" id="ArtDescription" cols="60" rows="6"></textarea></td>
</tr>
<tr>
  <td valign="top" class="b1_1"><p>下载内容说明</p>
    <p>发布时间<br>
      <input name="DateAndTime" type="text" id="DateAndTime" value="<%=NOW()%>">
    </p>
    <p>
      <input name="sSaveFileSelect" type="checkbox" class="noborder" id="sSaveFileSelect" value="True">
    保存内容中的图片到本地</p></td>
  <td class="b1_1"><textarea name="Content" style="width:100%;height:350px;" id="Content"></textarea></td>
</tr>
<tr>
  <td class="b1_1">附加选项</td>
  <td class="b1_1">固顶
    <input name="IsTop" type="checkbox" class="noborder" id="IsTop" value="1">
    推荐
    <input name="IsHot" type="checkbox" class="noborder" id="IsHot" value="1">
    幻灯
    <input name="IsFlash" type="checkbox" class="noborder" id="IsFlash" value="1">
    <INPUT type=button class="bnt" onClick="javascript:KE.insertHtml('Content', '[yao_page]');" value="插入分页符"></td>
</tr>
<tr>
  <td class="b1_1">自动分页<strong>字数</strong></td>
  <td class="b1_1"><input name="PageNum" type="text" id="PageNum" value="0" size="6" maxlength="4">
    <span class="note"> 注:如果在内容中加入了手动分页符,请填写0</span></td>
</tr>
<tr>
  <td class="b1_1">浏览权限</td>
  <td class="b1_1"><select name="ReadPower" size=4 multiple id="ReadPower">
    <%=ShowlevelOption(-1)%>
  </select>
    <span class="note">注:当选择中包含游客等级时,所有用户都可查看。可按住Ctrl多选!</span></td>
</tr>
<%If Mydb("Select Count([ID]) From ["&tbname&"_Vote]",1)(0)>0 then%>
<tr>
  <td class="b1_1">本文显示投票</td>
  <td class="b1_1"><select name="Vote" size=4 multiple id="Vote">
    <%=ShowVoteList(0)%>
  </select><span class="note"> 可按住Ctrl多选</span></td>
</tr><%End if%>
<tr>
<td width="20%" class="b1_1"></td>
<td class="b1_1"><input name="button" type="submit" class="bnt" value="添 加"></td>
</tr>
</form>
</table>
<%
end sub

sub savenew()
    Title            =Replace(trim(request.form("Title")),"'","")
    Hits            =trim(request.form("Hits"))
    ClassID            =trim(request.form("ClassID"))
    Content            =request.form("Content")
    Author            =trim(request.form("Author"))
    ShouQuan        =trim(request.form("ShouQuan"))
    YiYan            =trim(request.form("YiYan"))
    LeiXing            =trim(request.form("LeiXing"))
    GeShi            =trim(request.form("GeShi"))
    HuanJing        =trim(request.form("HuanJing"))
    CopyFrom        =trim(request.form("CopyFrom"))
    KeyWord            =trim(request.form("KeyWord"))
    IsTop            =request.form("IsTop")
    IsHot            =request.form("IsHot")
    IsFlash            =request.form("IsFlash")
    ArtDescription    =request.form("ArtDescription")
    TitleFontColor    =request.form("TitleFontColor")
    Images            =trim(request.form("Images"))
    PageNum            =trim(request.form("PageNum"))
    LinkUrl            =trim(request.form("LinkUrl"))
    UseLinkUrl        =request.form("UseLinkUrl")
    DateAndTime        =trim(request.form("DateAndTime"))
    sSaveFileSelect =request.Form("sSaveFileSelect")
    Vote            =request.form("Vote")
    Vote             =replace(Vote," ","")
    ReadPower        =request.form("ReadPower")
    ReadPower         =replace(ReadPower," ","")
   
    if Title="" or ClassID="" then
        Call Alert ("请填写完整再提交",-1)
    end if
    If ClassID="-1" then
        Call Alert ("请选择正确的分类!",-1)
    End if        
    If LinkUrl="" and Content="" then
        Call Alert ("你没有填写内容",-1)
    End if

    set rs = server.CreateObject ("adodb.recordset")
    sql="select * from "&tbname&"_Down where Title='"&Title&"'"
    rs.open sql,conn,1,3
    if rs.eof and rs.bof then
        rs.AddNew
        rs("Title")                =Title
        rs("Hits")                =Hits
        rs("ClassID")            =ClassID
        rs("LinkUrl")            =LinkUrl
        rs("Author")            =Author
        rs("ShouQuan")            =ShouQuan
        rs("YiYan")            =YiYan
        rs("LeiXing")            =LeiXing
        rs("GeShi")            =GeShi
        rs("HuanJing")            =HuanJing

        rs("CopyFrom")            =CopyFrom
        rs("KeyWord")            =KeyWord
        If IsTop=1 then
            rs("IsTop")                =1
        else
            rs("IsTop")                =0
        end if
        If IsHot=1 then
            rs("IsHot")                =1
        else
            rs("IsHot")                =0
        end if
        If IsFlash=1 then
            rs("IsFlash")            =1
        else
            rs("IsFlash")            =0
        end if
        If ArtDescription<>"" then
            rs("ArtDescription")        =ArtDescription
        Else
            rs("ArtDescription")        =Left(LoseHtml(Content),100)
        End if
        rs("TitleFontColor")    =TitleFontColor
        If Images<>"" then
        rs("Images")            =Images
        Else
           rs("Images")=GetImg(Content)
           Cimg=""
           Cimg=GetImg(Content)
           If Cimg<>"" then
           rs("IsFlash")=1
           Else
           rs("IsFlash")=0
           End if
        End if
        rs("yn")                =0
        rs("PageNum")            =PageNum
        rs("DateAndTime")        =DateAndTime
        rs("Vote")                =Vote
        rs("ReadPower")            =ReadPower
        rs("UserName")            =myadminuser
        If sSaveFileSelect="True" Then
              Rs("Content")=ReplaceRemoteUrl(Content,SitePath&SiteUp&"/" & Year(Now) & right("0" & Month(Now), 2) & "/",sFileExt)
         Else
              Rs("Content")=Content
        End If

        rs.update
        session("YaoClassID")=ClassID
        Call Alert ("添加成功!","Admin_Down.asp")
    else
        Call Alert ("该下载已存在!",-1)
    end if
    rs.close
    set rs=nothing
end sub

sub edit()
id=request("id")
set rs = server.CreateObject ("adodb.recordset")
sql="select * from "&tbname&"_Down where id="& id &""
rs.open sql,conn,1,1
%>
<table width="95%" border="0"  align=center cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" class="admintable">
<form onSubmit="return CheckForm();" id="myform" name="myform" action="?action=savedit" method=post>
<tr>
    <td colspan="5" class="admintitle">修改下载</td></tr>
<tr>
  <td width="20%" bgcolor="#FFFFFF" class="b1_1">标题</td>
  <td colspan=4 class=b1_1><input name="Title" type="text" value="<%=rs("Title")%>" size="40" maxlength="50">
        <input name="TitleFontColor" type="hidden" id="TitleFontColor" value="<%=rs("TitleFontColor")%>" onClick="Getcolor(ColorBG,'TitleFontColor');" Readonly>
      <img border=0 src="../images/Rect.gif" style="cursor:pointer;background:<%=rs("TitleFontColor")%>" onClick="Getcolor(this,'TitleFontColor');" title="选取标题颜色" align="absmiddle" ID="ColorBG">&nbsp;<span class="note">注:最多50个字符</span></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">关键字【<a href="#" id="KeyLinkByTitle" style="color:green">根据标题自动获取</a>】</td>
  <td colspan=4 class=b1_1><input name="KeyWord" type="text" id="KeyWord" value="<%=rs("KeyWord")%>" size="40">&nbsp;<span class="note">多个关键字用|隔开</span></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">录入员</td>
  <td colspan=4 class=b1_1><input name="UserName" type="text" id="UserName" value="<%=rs("UserName")%>" size="40"></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">授权方式</td>
  <td colspan=4 class=b1_1><input name="ShouQuan" type="text" id="ShouQuan" value="<%=rs("ShouQuan")%>" size="40"></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">界面语言</td>
  <td colspan=4 class=b1_1><input name="YiYan" type="text" id="YiYan" value="<%=rs("YiYan")%>" size="40"></td>
</tr>

<tr>
  <td bgcolor="#FFFFFF" class="b1_1">软件大小</td>
  <td colspan=4 class=b1_1><input name="Author" type="text" id="Author" value="<%=rs("Author")%>" size="40"></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">推荐等级</td>
  <td colspan=4 class=b1_1><input name="LeiXing" type="text" id="LeiXing" value="<%=rs("LeiXing")%>" size="40"></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">资源格式</td>
  <td colspan=4 class=b1_1><input name="GeShi" type="text" id="GeShi" value="<%=rs("GeShi")%>" size="40"></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">平台环境</td>
  <td colspan=4 class=b1_1><input name="HuanJing" type="text" id="HuanJing" value="<%=rs("HuanJing")%>" size="40"></td>
</tr>

搜索更多相关主题的帖子: 怎样 include 
2012-01-11 12:54
znmw
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2011-3-6
收藏
得分:0 
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">演示地址</td>
  <td colspan=4 class=b1_1><input name="CopyFrom" type="text" id="CopyFrom" value="<%=rs("CopyFrom")%>" size="40"></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">分类</td>
  <td colspan=4 class=b1_1><select ID="ClassID" name="ClassID">
   <%
   Set Rsp=server.CreateObject("adodb.recordset")
   Sqlp ="select * from "&tbname&"_DownClass Where TopID = 0 and link=0 order by num"   
   rsp.open sqlp,conn,1,1
   Response.Write("<option value="""">请选择分类</option>")
   If Rsp.Eof and Rsp.Bof Then
      Response.Write("<option value="""">请先添加分类</option>")
   Else
      Do while not Rsp.Eof   
         Response.Write("<option")
         If rs("ClassID")=Rsp("ID") Then
            Response.Write(" selected")
         End If
         If Yao_MyID(rsp("ID"))<>"0" then
                 Response.Write(" value=""-1"" style='background:#f7f7f7;color:#ccc;'")
         Else
             If yaoadmintype<>1 then
                If instr(","&yaoWritePower&",",","& rsp("ID") &",") <> 0 or instr(","&yaoManagePower&",",","& rsp("ID") &",") <> 0 then
                    Response.Write(" value=" & """" & Rsp("ID") & """" & " style='color:#0000ff;'")
                Else
                    Response.Write(" value=""-1"" style='background:#f7f7f7;color:#ccc;'")
                End if
            else
                Response.Write(" value=" & """" & Rsp("ID") & """" & " style='color:#0000ff;'")
            End if
         End if
         Response.Write(">|-" & Rsp("ClassName") & "</option>")  & VbCrLf
         
         Sqlpp ="select * from "&tbname&"_DownClass Where TopID="&Rsp("ID")&" and link=0 order by num"   
               Set Rspp=server.CreateObject("adodb.recordset")   
               rspp.open sqlpp,conn,1,1
            Do while not Rspp.Eof
                Response.Write("<option value=" &Rspp("ID")& "")
                If rs("ClassID")=Rspp("ID") Then
                Response.Write(" selected")
                 End If
                If yaoadmintype<>1 then
                    If instr(","&yaoWritePower&",",","& rspp("ID") &",") <> 0 or instr(","&yaoManagePower&",",","& rspp("ID") &",") <> 0 then
                        Response.Write(" value=" & """" & Rspp("ID") & """" & " style='color:#0000ff;'")
                    Else
                        Response.Write(" value=""-1"" style='background:#f7f7f7;color:#ccc;'")
                    End if
                else
                    Response.Write(" value=" & """" & Rspp("ID") & """" & " style='color:#0000ff;'")
                End if
                 Response.Write("> |-" & Rspp("ClassName") & "")
                Response.Write("</option>" )
            Rspp.Movenext   
              Loop
            rspp.close
            set rspp=nothing
      Rsp.Movenext   
      Loop   
   End if
   rsp.close
   set rsp=nothing
   %>
  </select>  </td></tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">转向链接</td>
  <td colspan=4 class=b1_1><input name="LinkUrl" type="text" size="50" value="<%=rs("Linkurl")%>" disabled>
          <INPUT name="UseLinkUrl" type="checkbox" class="noborder" id="UseLinkUrl" onClick="if(this.checked){
              LinkUrl.disabled = false;
          }else{
              LinkUrl.disabled = true;
          }" value="Yes"<%if rs("LinkUrl")<>"" then Response.Write(" checked") end if%>>
      使用转向链接        </td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">浏览次数</td>
  <td colspan=4 class=b1_1><input name="Hits" type="text" id="Hits" value="<%=rs("Hits")%>" size="6" maxlength="5"></td>
</tr>
<tr>
  <td rowspan="2" bgcolor="#FFFFFF" class="b1_1">缩略图</td>
  <td colspan=4 class=b1_1><input name="Images" type="text" id="Images" value="<%=rs("Images")%>" size="50" maxlength="200"></td></tr>
<tr>
  <td colspan=4 class=b1_1><iframe src="upload.asp?action=simg" width="400" height="25" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">文章摘要</td>
  <td colspan=4 class=b1_1><textarea name="ArtDescription" id="ArtDescription" cols="60" rows="6"><%=rs("ArtDescription")%></textarea></td></tr>
<tr>
  <td valign="top" bgcolor="#FFFFFF" class="b1_1"><p>内容</p>
    <p>发布时间<br>
      <input name="DateAndTime" type="text" id="DateAndTime" value="<%=rs("DateAndTime")%>">
</p>
    <p>
      <input name="sSaveFileSelect" type="checkbox" class="noborder" id="sSaveFileSelect" value="True">
保存内容中的图片到本地</p><br><br><p>附件上传:</p><br><p><iframe id="UpLoadIframe" src="Admin_FileUp.asp" scrolling="no" frameborder="0" width="100%" height="50"  ></iframe></p></td>
  <td colspan=4 class=b1_1><textarea name="Content" style="width:100%;height:350px;" id="Content"><%=server.htmlencode(rs("Content"))%></textarea></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">附加选项</td>
  <td colspan=4 class=b1_1>固顶
    <input name="IsTop" type="checkbox" class="noborder" id="IsTop" value="1"<%if rs("IsTop")=1 then Response.Write("checked") end if%>>
推荐
<input name="IsHot" type="checkbox" class="noborder" id="IsHot" value="1"<%if rs("IsHot")=1 then Response.Write("checked") end if%>>
幻灯
<input name="IsFlash" type="checkbox" class="noborder" id="IsFlash" value="1"<%if rs("IsFlash")=1 then Response.Write("checked") end if%>>
<INPUT type=button class="bnt" onClick="javascript:KE.insertHtml('Content', '[yao_page]');" value="插入分页符"></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">自动分页<strong>字数</strong></td>
  <td colspan=4 class=b1_1><input name="PageNum" type="text" id="PageNum" value="<%=rs("PageNum")%>" size="6" maxlength="4"><span class="note"> 注:如果在内容中加入了手动分页符,请填写0</span></td>
</tr>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">浏览权限</td>
  <td colspan=4 class=b1_1><select name="ReadPower" size=4 multiple id="ReadPower">
    <%=ShowlevelOption(rs("ReadPower"))%>
  </select>
    <span class="note">注:当选择中包含游客等级时,所有用户都可查看。可按住Ctrl多选!</span></td>
</tr>
<%If Mydb("Select Count([ID]) From ["&tbname&"_Vote]",1)(0)>0 then%>
<tr>
  <td bgcolor="#FFFFFF" class="b1_1">本文显示投票</td>
  <td colspan=4 class=b1_1><select name="Vote" size=4 multiple id="Vote">
    <%=ShowVoteList(rs("Vote"))%>
  </select>
    <span class="note"> 可按住Ctrl多选</span></td>
</tr><%End if%>
<tr>
<td width="20%" class="b1_1"></td>
<td colspan=4 class=b1_1><input name="id" type="hidden" value="<%=rs("ID")%>"><input name="page" type="hidden" value="<%=page%>"><input name="button" type="submit" class="bnt" value="编 辑"></td>
</tr>
</form>
</table>
<%
rs.close
set rs=nothing
end sub

sub savedit()
    Dim Title
    id=request.form("id")
    page=request.form("page")
    Title            =trim(request.form("Title"))
    Hits            =trim(request.form("Hits"))
    ClassID            =trim(request.form("ClassID"))
    Content            =request.form("Content")
    Author            =trim(request.form("Author"))
    ShouQuan        =trim(request.form("ShouQuan"))
    YiYan            =trim(request.form("YiYan"))
    LeiXing            =trim(request.form("LeiXing"))
    GeShi            =trim(request.form("GeShi"))
    HuanJing        =trim(request.form("HuanJing"))
    UserName        =trim(request.form("UserName"))
    CopyFrom        =trim(request.form("CopyFrom"))
    KeyWord            =trim(request.form("KeyWord"))
    IsTop            =request.form("IsTop")
    IsHot            =request.form("IsHot")
    IsFlash            =request.form("IsFlash")
    ArtDescription    =request.form("ArtDescription")
    TitleFontColor    =request.form("TitleFontColor")
    Images            =trim(request.form("Images"))
    PageNum            =trim(request.form("PageNum"))
    LinkUrl            =trim(request.form("LinkUrl"))
    UseLinkUrl        =request.form("UseLinkUrl")
    DateAndTime        =trim(request.form("DateAndTime"))
    sSaveFileSelect =request.Form("sSaveFileSelect")
    Vote            =request.form("Vote")
    Vote             =replace(Vote," ","")
    ReadPower        =request.form("ReadPower")
    ReadPower         =Replace(ReadPower," ","")
   
    if Title="" or ClassID="" then
        Call Alert ("请填写完整再提交","-1")
    end if
    If ClassID="-1" then
        Call Alert ("请选择正确的分类!",-1)
    End if        
    If LinkUrl="" and Content="" then
        Call Alert ("你没有填写内容","-1")
    End if
    set rs = server.CreateObject ("adodb.recordset")
    sql="select * from "&tbname&"_Down where ID="&id&""
    rs.open sql,conn,1,3
    if not(rs.eof and rs.bof) then
   
        rs("Title")                =Replace(Title,CHR(34),"&quot;")
        rs("Hits")                =Hits
        rs("ClassID")            =ClassID
        rs("LinkUrl")            =LinkUrl
        rs("Author")            =Author
        rs("ShouQuan")            =ShouQuan
        rs("YiYan")            =YiYan
        rs("LeiXing")            =LeiXing
        rs("GeShi")            =GeShi
        rs("HuanJing")            =HuanJing

        If UserName<>"" then
        rs("UserName")            =UserName
        Else
        rs("UserName")            =myadminuser
        End if
        rs("CopyFrom")            =CopyFrom
        rs("KeyWord")            =KeyWord
        If IsTop=1 then
            rs("IsTop")                =1
        else
            rs("IsTop")                =0
        end if
        If IsHot=1 then
            rs("IsHot")                =1
        else
            rs("IsHot")                =0
        end if
        If IsFlash=1 then
            rs("IsFlash")            =1
        else
            rs("IsFlash")            =0
        end if
        If ArtDescription<>"" then
            rs("ArtDescription")        =ArtDescription
        Else
            rs("ArtDescription")        =Left(LoseHtml(Content),100)
        End if
        rs("TitleFontColor")    =TitleFontColor
        rs("Images")            =Images
        rs("yn")                =0
        rs("PageNum")            =PageNum
        rs("DateAndTime")        =DateAndTime
        rs("Vote")                =Vote
        rs("ReadPower")            =ReadPower
        If sSaveFileSelect="True" Then
              Rs("Content")=ReplaceRemoteUrl(Content,SitePath&SiteUp&"/" & Year(Now) & right("0" & Month(Now), 2) & "/",sFileExt)
         Else
              Rs("Content")=Content
        End If
        
        rs.update
        Call Alert("修改成功!",-2)
    else
        Call Alert("修改错误!",-2)
    end if
    rs.close
    set rs=nothing
end sub
sub Admin_ShowClass_Option()
   Dim Sqlp,Rsp,TempStr
   Sqlp ="select * from "&tbname&"_DownClass Where TopID = 0 and link=0 order by num"   
   Set Rsp=server.CreateObject("adodb.recordset")   
   rsp.open sqlp,conn,1,1
   Response.Write("<option value="""">请选择分类</option>")
   If Rsp.Eof and Rsp.Bof Then
      Response.Write("<option value="""">请先添加分类</option>")
   Else
      Do while not Rsp.Eof   
         Response.Write("<option")
         If int(session("YaoClassID"))=Rsp("ID") then
                Response.Write(" selected" )
         End if
         If Yao_MyID(rsp("ID"))<>"0" then
                 Response.Write(" value=""-1"" style='background:#f7f7f7;color:#ccc;'")
         Else
             If yaoadmintype<>1 then
                If instr(","&yaoWritePower&",",","& rsp("ID") &",") <> 0 or instr(","&yaoManagePower&",",","& rsp("ID") &",") <> 0 then
                    Response.Write(" value=" & """" & Rsp("ID") & """" & " style='color:#0000ff;'")
                Else
                    Response.Write(" value=""-1"" style='background:#f7f7f7;color:#ccc;'")
                End if
            else
                Response.Write(" value=" & """" & Rsp("ID") & """" & " style='color:#0000ff;'")
            End if
         End if
         Response.Write(">|-" & Rsp("ClassName") & "</option>") & VbCrLf
         
            Sqlpp ="select * from "&tbname&"_DownClass Where TopID="&Rsp("ID")&" and link=0 order by num"   
               Set Rspp=server.CreateObject("adodb.recordset")   
               rspp.open sqlpp,conn,1,1
            Do while not Rspp.Eof
                Response.Write("<option")
                If int(session("YaoClassID"))=Rspp("ID") then
                Response.Write(" selected" )
                End if
                If yaoadmintype<>1 then
                    If instr(","&yaoWritePower&",",","& rspp("ID") &",") <> 0 or instr(","&yaoManagePower&",",","& rspp("ID") &",") <> 0 then
                        Response.Write(" value=" & """" & Rspp("ID") & """" & " style='color:#0000ff;'")
                    Else
                        Response.Write(" value=""-1"" style='background:#f7f7f7;color:#ccc;'")
                    End if
                else
                    Response.Write(" value=" & """" & Rspp("ID") & """" & " style='color:#0000ff;'")
                End if
                 Response.Write("> |-" & Rspp("ClassName") & "")
                Response.Write("</option>" )
            Rspp.Movenext   
              Loop
            rspp.close
            set rspp=nothing
      Rsp.Movenext   
      Loop   
   End if
   rsp.close
   set rsp=nothing
end sub

Sub delAll
ID=Trim(Request("ID"))
ytype=Request("ytype")
page=request("page")
If ID="" Then
      Call Alert("请选择文章!",-1)
ElseIf Request("Del")="批量未审" Then
   set rs=conn.execute("Update "&tbname&"_Down set yn = 1 where ID In(" & ID & ")")
ElseIf Request("Del")="更新时间" Then
   set rs=conn.execute("Update "&tbname&"_Down set DateAndTime = "&SqlNowString&" where ID In(" & ID & ")")
ElseIf Request("Del")="批量审核" Then
   set rs=conn.execute("Update "&tbname&"_Down set yn = 0 where ID In(" & ID & ")")
ElseIf Request("Del")="推荐" Then
   set rs=conn.execute("Update "&tbname&"_Down set IsHot = 1 where ID In(" & ID & ")")
ElseIf Request("Del")="解除推荐" Then
   set rs=conn.execute("Update "&tbname&"_Down set IsHot = 0 where ID In(" & ID & ")")
ElseIf Request("Del")="固顶" Then
   set rs=conn.execute("Update "&tbname&"_Down set IsTop = 1 where ID In(" & ID & ")")
ElseIf Request("Del")="解除固顶" Then
   set rs=conn.execute("Update "&tbname&"_Down set IsTop = 0 where ID In(" & ID & ")")
ElseIf Request("Del")="移动" Then
        If ytype="" or ytype="-1" then
            Call Alert("请选择正确的类别",-1)
        End if
   set rs=conn.execute("Update "&tbname&"_Down set ClassID = "&ytype&" where ID In(" & ID & ")")
ElseIf Request("Del")="删除" Then
    'set rs=conn.execute("delete from "&tbname&"_Down where ID In(" & ID & ")")
            for i=1 to request("ID").count
                if request("ID").count=1 then
                DownID=request("ID")
                else
                DownID=replace(request("id")(i),"'","")
                end if
                '对用户分值操作
                Call EditUserMn(DownID,money3,0)
                '删除文章
                Conn.Execute("Delete From ["&tbname&"_Down] where ID = "&DownID&"")
                '删除文章相关评论
                Conn.Execute("Delete From ["&tbname&"_Pl] where DownID = "&DownID&"")
            next
End If
Dim newOK
newOK=request.servervariables("http_referer")
If newOK="" then newOK=-1
Call Alert("操作成功",newOK)
End Sub
%>
<!--#include file="Admin_copy.asp"-->
</body>
</html>

俺不高手,俺也是来学习的。
2012-01-11 13:13
znmw
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2011-3-6
收藏
得分:0 
不用了,自己搞定了,谢谢大家进来访问.

俺不高手,俺也是来学习的。
2012-01-11 21:56
快速回复:新手的困扰,源码加入一此些代码后就不行了。请高手帮忙,谢谢!
数据加载中...
 
   



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

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