% if FormatSQL(SafeRequest("action",0))="del" then conn.execute "delete from news where newsid in ("&request.form("selectdel")&")" response.Redirect "editnews.asp" end if %>
| 新闻修改删除 |
<% Const MaxPerPage=20 dim totalPut dim CurrentPage dim TotalPages dim j dim sql if Not isempty(SafeRequest("page",1)) then currentPage=Cint(SafeRequest("page",1)) else currentPage=1 end if set rs=server.createobject("adodb.recordset") rs.open "select newsid,newsname,addname,adddate from news order by adddate desc",conn,1,1 if err.number<>0 then response.write "数据库中暂时无数据" end if if rs.eof And rs.bof then Response.Write " 您还没有添加新闻! " else totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showContent showpage totalput,MaxPerPage,"editnews.asp" else if (currentPage-1)*MaxPerPage |