批量删除代码分页显示已搞好!
兄弟以下是你帮我改好的代码,但我现在就是加了条件就不能下一页拉为什么拉sql="select * from upfile"
改成有条件的拉sql="select * from upfile where username='"&user&"'"
程序代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.> <html xmlns="http://www.> <head> <title>1323</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link rel="stylesheet" href="inc/admin.css" type="text/css"> <SCRIPT language=JavaScript type=text/JavaScript> function CheckAll(form) { for (var i=0;i<form.elements.length;i++) { var e = form.elements[i]; if (e.name != 'chkall') e.checked = form.chkall.checked; } } </SCRIPT> </head> <body> <div> <form name="del" action="del_skins.asp" method="post"> <table width="70%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#3399CC"> <tr> <td width="5%" height="25" align="center"><font color="red">ID号</font></td> <td width="10%" height="25" align="center"><font color="red">用户</font></td> <td width="10%" height="25" align="center"><font color="red">皮肤名称</font></td> <td width="10%" height="25" align="center"><font color="red">文件名</font></td> <td width="10%" height="25" align="center"><font color="red">皮肤路径</font></td> <td width="5%" height="25" align="center"> </td> <td width="5%" align="center"><font color="red">删除</font></td> </tr> <% set rs=server.createobject("adodb.recordset") sql="select * from upfile" rs.open sql,conn,1,3 Dim TotalPage,CurrentPage,TotalCount rs.PageSize=5 '每页数量 TotalPage=rs.Pagecount '总页数 TotalCount=rs.RecordCount '总数量 CurrentPage=request("page") '当前页 if not isNumeric(CurrentPage) or CurrentPage="" then CurrentPage=1 else CurrentPage=Clng(CurrentPage) end if if CurrentPage>TotalPage then CurrentPage=TotalPage end if rs.AbsolutePage=CurrentPage for i=1 to rs.PageSize if rs.eof then Exit for %> <tr> <td align="center"><input align="center" name="-" type="text" class="input1" id="-" value="<%=rs("id")%>" size="10" maxlength="100" disabled></td> <td align="center"><input align="center" name="username" type="text" class="input1" id="username" value="<%=rs("username")%>" size="15" maxlength="100"></td> <td align="center"><input name="fileremark" type="text" class="input1" id="fileremark" value="<%=rs("fileremark")%>" size="15" maxlength="100"></td> <td align="center"><input name="filename" type="text" class="input1" id="filename" value="<%=rs("filename")%>" size="15" maxlength="100"></td> <td align="center"><input name="fileurl" type="text" class="input1" id="look" value="<%=rs("fileurl")%>" size="15" maxlength="100"></td> <td height="25" align="center"><label> <input type="checkbox" name="id" value="<%=rs("id")%>"> </label></td> <td align="center">删除</td> </tr> <% rs.movenext Next %> <tr> <td height="25" align="center"> </td> <td height="25" align="center"><label> <input name="chkall" type="checkbox" id="chkall" value="select" onclick=CheckAll(this.form)> </label></td> <td align="center">选中全部</td> </tr> <tr> <td height="25" colspan="3" align="center"><label> <input type="submit" name="Submit" value="删除所选" onclick="{if(confirm('确定要删除皮肤及文件吗?')){return true;}return false;}" /> <input type="reset" name="Submit2" value="重置" /> </label></td> </tr> </table> </form> <div><% Response.Write("共"&TotalCount&"个") if CurrentPage=1 then Response.Write(" 首页 上一页 ") else Response.Write(" <a href=""?page=1"">首页</a> ") Response.Write(" <a href=""?page="&CurrentPage-1&""">上一页</a> ") end if if CurrentPage=TotalPage then Response.Write(" 下一页 尾页 ") else Response.Write(" <a href=""?page="&CurrentPage+1&""">下一页</a> ") Response.Write(" <a href=""?page="&TotalPage&""">尾页</a> ") end if Response.Write(CurrentPage&"/"&TotalPage) %></div> </body> </html>
[ 本帖最后由 ningzhonghui 于 2010-12-28 09:39 编辑 ]