| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 488 人关注过本帖
标题:希望各个大大帮帮忙
只看楼主 加入收藏
gnjrblmao
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-11-13
收藏
 问题点数:0 回复次数:1 
希望各个大大帮帮忙
<!--#include file="conn.asp"-->
<!--#include file="../inc/function.asp"-->
<%if session("china_admin")="" then response.redirect "login.asp"
dim action,id,dname
id=strint(request.QueryString("id"))
action=HtmlEncode(request.querystring("action"))
dname=HtmlEncode(request("dname"))
dbpath="../"
dblink
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
 rs.open "select * from china_type where name='"&dname&"' and threeid=0 and twoid=0",conn,1,1
         if rs.EOF and rs.BOF then
           rs.close
    rs.open "select * from china_type where threeid=0 and twoid=0 order by id desc",conn,1,1
    if rs.eof and rs.bof then
    id=1
    else
    id=rs("id")+1
    end if
    rs.close
    rs.open "china_type",conn,1,3
    rs.AddNew
if id=0 then
   rs("id")=1
   else
   rs("id")=id
    end if
rs("name")=dname
rs("indexid")=strint(request("indexid"))
rs("indexshow")=request("indexshow")
rs("titlecolor")=request("colorshow")
rs.Update
rs.Close
set rs=nothing
else
response.write "<script>window.alert('你输入的一级目录名称:"&dname&"已经有了!');history.go(-1);</script>"
end if
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from china_type where twoid=0 and id="&id,conn,1,3
yname=rs("name")
rs("name")=dname
rs("indexid")=strint(request("indexid"))
rs("indexshow")=request("indexshow")
rs("titlecolor")=request("colorshow")
rs.Update
rs.Close
set rs=nothing
sql="update china_data set type_one='"&dname&"' where type_oneid="&id&" and type_twoid=0"
conn.execute sql

case "del"
set rs=server.CreateObject("adodb.recordset")
conn.execute ("delete from china_type where id="&id&"")
sql="select * from china_data where type_oneid = "&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
Set fdel = CreateObject("Scripting.FileSystemObject")    
if not rs.eof then
 For iPage = 1 To rs.recordcount
 adid=rs("adid")
 pic=rs("pic")
rs.delete
rs.update
sql1="delete from china_message where adid ="&adid&""   
conn.execute(sql1)
rs.movenext  
   '''''''''''删除html开始''''''''''''''''

              tempImageDir = Server.MapPath("../html/"&adid&".htm")
                 fdel.DeleteFile(tempImageDir)
                 if pic<>"" and lcase(left(pic,7))<>"http://" and lcase(right(pic,3))<>"asp" then
                 fdel.DeleteFile(Server.MapPath("../adpic/"&pic&""))
                 end if
            
'''''''''''删除html结束'''''''''''''''
if rs.eof then exit for
next
set fdel=nothing
rs.close  
set rs=nothing                                 
end if
conn.close   
set conn=nothing
response.Redirect "typeedit.asp"
end select
%>
<HTML>
<HEAD>
<LINK rel="stylesheet" type="text/css" href="style.css">
<SCRIPT language="javascript" src="admin.js"></SCRIPT>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<META name="GENERATOR" content="Microsoft FrontPage 4.0">
<META name="ProgId" content="FrontPage.Editor.Document">
<TITLE>分类管理</TITLE>
</HEAD>

<BODY background="images/background.gif">
<IFRAME width="260" height="165" id="colourPalette" src="nc_selcolor.htm" style="visibility:hidden; position: absolute; left: 0px; top: 0px;border:1px gray solid" frameborder="0" scrolling="no" ></IFRAME>

<TABLE width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
  <TR>
    <TD height="20" bgcolor="#799AE1" align="center"><FONT color="#FFFFFF" style="font-size:14px">一&nbsp;级&nbsp;分 类 栏&nbsp;目&nbsp;管 理</FONT></TD>
  </TR>
  <TR>
    <TD bgcolor="#FFFFFF"> &nbsp;首页 <BR>
    <TABLE width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
        <TR align="center" bgcolor="#FFFFFF" height="20">
          <TD width="30">编号</TD>
          <TD>分类名称</TD>
          <TD>显示顺序</TD>
          <TD>首页显示</TD>
          <TD>首页配色</TD>
          <TD>管理操作</TD>
        </TR>
        <%set rs=server.CreateObject("adodb.recordset")
          rs.Open "select * from china_type where twoid=0 and id>0 order by id",conn,1,1
          dim follows
          if rs.EOF and rs.BOF then
          response.write"<tr bgcolor=#FFFFFF><td colspan='6'><p align='center'><font color='red'>暂无分类!</font></td></tr></table><br>"
          follows=0
          else
          do while not rs.EOF
          i=i+1
          %>
        <FORM name="form1" method="post" action="typeedit.asp?action=edit&id=<%=int(rs("id"))%>">
          <TR bgcolor="#FFFFFF" align="center">
          <TD><%=i%></TD>
            <TD><INPUT name="dname" type="text" size="12" value="<%=rs("name")%>">
            &nbsp;[<A href="typeedit_two.asp?id=<%=rs("id")%>">子目录</A>]</TD>
            <TD><INPUT name="indexid" type="text" size="2" value="<%=rs("indexid")%>"></TD>
            <TD><SELECT name="indexshow">
<OPTION value="yes" <%if rs("indexshow")="yes" then%>selected<%end if%>>显示</OPTION>
<OPTION value="no" <%if rs("indexshow")="no" then%>selected<%end if%>>隐藏</OPTION>
                    </SELECT></TD>
            <TD><INPUT name="colorshow" type="text" style="background:<%=rs("titlecolor")%>" onClick="Getcolor(this)" value="<%=rs("titlecolor")%>" size="7" maxlength="7"></TD>
            <TD><INPUT type="submit" name="Submit" value="修 改">
                &nbsp; <INPUT type="button" name="DEL" onClick="{if(confirm('确定要删除这个分类吗?\n将删除此分类下所有信息\n此操作不可以恢复!')){location.href='?name=<%=rs("name")%>&action=del&id=<%=rs("id")%>';}return false;}" value="删除" >
            </TD>
          </TR>
        </FORM>
        <%
        rs.MoveNext
          loop
          follows=rs.RecordCount
          end if%>
      </TABLE>
    <BR></TD>
  </TR>
</TABLE>
<BR>
<TABLE width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
  <TR>
    <TD height="20" bgcolor="#799AE1" align="center"><FONT color="#FFFFFF" style="font-size:14px">添 加 一&nbsp;级&nbsp;分 类 名 称</FONT></TD>
  </TR>
  <TR>
    <TD bgcolor="#FFFFFF">
    <BR>
    <TABLE width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
        <TR align="center" bgcolor="#FFFFFF" height="20">
          <TD width="30">编号 </TD>
          <TD>分类名称</TD>
          <TD>显示顺序</TD>
          <TD>首页显示</TD>
          <TD>首页配色</TD>
          <TD>确定操作</TD>
        </TR>
        <FORM name="form1" method="post" action="typeedit.asp?action=add">
          <TR align="center" bgcolor="#FFFFFF">
            <TD><%=rs.RecordCount+1%></TD>
            <TD><INPUT name="dname" type="text" id="dname" size="12"></TD>
            <TD><INPUT name="indexid" type="text" value="0" size="2"></TD>
            <TD><SELECT name="indexshow">
                <OPTION value="yes" selected>显示</OPTION>
                <OPTION value="no">隐藏</OPTION>
            </SELECT></TD>
             <TD><INPUT name="colorshow" type="text" style="background:#000000" onClick="Getcolor(this)" value="#000000" size="7" maxlength="7"></TD>
            <TD><INPUT type="submit" name="Submit3" value="添 加" onClick="if(dname.value==''){alert('分类名不能为空');return false;}"></TD>
          </TR>
        </FORM>
      </TABLE>
<BR></TD>
</TR>
</TABLE>
</BODY>                                                                                                   </HTML>  
这是我网站的一个页面的代码,可能每当我删除数据时他就会
错误类型:
Microsoft VBScript 运行时错误 (0x800A0035)
文件未找到
/www/4.7/admin/typeedit_two.asp, 第 74 行
是什么问题呀?求大家帮一下我吧.
搜索更多相关主题的帖子: ASP 
2008-11-13 12:16
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
id=strint(request.QueryString("id"))
action=HtmlEncode(request.querystring("action"))
改成
id=request.QueryString("id")
action=request.querystring("action")

<INPUT type="button" name="DEL" onClick="{if(confirm('确定要删除这个分类吗?\n将删除此分类下所有信息\n此操作不可以恢复!')){location.href='?name=<%=rs("name")%>&action=del&id=<%=rs("id")%>';}return false;}" value="删除" >
改成
<INPUT type="button" name="DEL" onClick="{if(confirm('确定要删除这个分类吗?\n将删除此分类下所有信息\n此操作不可以恢复!')){location.href='?dname=<%=rs("name")%>&action=del&id=<%=rs("id")%>';}return false;}" value="删除" >

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2008-11-13 12:22
快速回复:希望各个大大帮帮忙
数据加载中...
 
   



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

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