⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 verify.asp

📁 这《ASP网络编程从入门到精通》书中的全部源程序
💻 ASP
字号:

<!--#include file="conn.asp"-->
<%
if session("admin")="" then
response.write "<Script>window.alert('您目前还没有登录,请先登录!');location.replace('index.asp');</Script>"
end if
If Request("action")="delete" Then
	'If (confirm("确定删除吗?")) Then
		delid=replace(request("id"),",","")						'获得要删除记录的id,Replace 过程将获得的id 字符串中的"'"用空字符""替换
		if delid="" or isnull(delid) then						'要删除的记录id 为空
			'则给出提示
			response.write "<script>alert('操作失败,没有选择合适参数,请单击确定返回!');</script>"		
			response.redirect "verify.asp"						'返回到网站审核界面
			response.end

		else													'id 存在
			'执行数据库中的删除操作,删除数据库中id 列的值在delid数组中的记录
			conn.Execute("delete * from web where ID in ("&delid&")")
			'删除成功,给出提示
			response.write "<script>alert('留言删除成功,请单击确定返回!');</script>"		
			response.redirect "verify.asp"						'返回到网站审核界面
			response.end
		end if
	'End If
End If
%>
<html>
<head>
<title>网站审核</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr bgcolor="#e9e9e9"> 
          <td width="65" height="25" valign="bottom"><table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="55" height="21"><a href="main.asp"><font color="#000000">网站管理</font></a></td>
              </tr>
            </table></td>
          <td width="65" valign="bottom"><table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="55" height="21"><a href="verify.asp"><font color="#000000">网站审核</font></a></td>
              </tr>
            </table></td>
         
          <td width="65" valign="bottom"><table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="55" height="21"><a href="sort_manage.asp"><font color="#000000">分类管理</font></a></td>
              </tr>
            </table></td>

          <td width="65" valign="bottom"><table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="55" height="21"><a href="login.asp?action=logout"><font color="#000000">退出系统</font></a></td>
              </tr>
            </table></td>
          <td></td>
        </tr>
        <tr bgcolor="#000000"> 
          <td height="3" colspan="10" valign="bottom"></td>
        </tr>
      </table></td>
  </tr>
    <tr> 
    <td> </td>
  </tr>
  <tr> 
    <td height="15"></td>
  </tr>
  <tr> 
    <td height="100%" valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="5">
        <form name="form" method="get" action="?">
          <tr> 
            <td> 
              <%
dim rs
set rs=server.createobject("adodb.recordset")						'创建RecordSet 对象
'从数据库中查询verify = -1 的记录,按照id降序排列,并保存在rs中
rs.open "select id,sort_id,title,url,verify,click,time from web where verify=-1 order by id desc",conn,1,1
if rs.eof and rs.bof then
'
else
	dim totalPut   
	dim CurrentPage
	dim TotalPages
	Const MaxPerPage=20
	if Not isempty(Request.QueryString("page")) then
		currentPage=Cint(Request.QueryString("page"))
	else
		currentPage=1
	end if 
	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,"verify.asp"
	else
		if (currentPage-1)*MaxPerPage<totalPut then
			rs.move  (currentPage-1)*MaxPerPage
			dim bookmark
			bookmark=rs.bookmark
			showContent
			showpage totalput,MaxPerPage,"verify.asp"
		else
			currentPage=1
			showContent
			showpage totalput,MaxPerPage,"verify.asp"
		end if
	end if
end if
sub showContent
	dim i
	i=0
	do while not rs.eof
%>
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr> 
                  <td width="25" height="20">  </td>
                  <td width="700"> <a href="web_manage.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a> 
                    [<a href="web_manage.asp?id=<%=rs("id")%>" target = _blank>修改</a>][<a href="?action=delete&id=<%=rs("id")%>">删除</a>]</td>
                </tr>
                <tr> 
                  <td height="20"></td>
                  <td><a href = <%=rs("url")%>><%=rs("url")%></a></td>
                </tr>
                <tr>
                  <td height="20"></td>
                  <td>                  
                    加入日期:<%=rs("time")%></td>
                </tr>
              </table>
              <br>
    <%
		i=i+1
		if i>=MaxPerPage then Exit Do
		rs.movenext
	loop
	%>
              <br> <table width="100%" border="0" cellpadding="5" cellspacing="0">
                <tr> 
                  <td align="center"> 
<%  
End Sub   
Function showpage(totalnumber,maxperpage,filename)  
  	Dim n				
	If totalnumber Mod maxperpage=0 Then  
		n= totalnumber \ maxperpage  
	Else
		n= totalnumber \ maxperpage+1  
	End If 
    If CurrentPage<2 Then 
    %>
                    第一页 上一页 
    <%
    Else
    %>
                    <a href="<%=filename%>?page=1">第一页</a> <a href="<%=filename%>?page=<%=CurrentPage-1%>">上一页</a> 
    <%
    End If
    If n-currentpage<1 Then
    %>
                    下一页 最后一页 
                    <%Else%>
                    <a href="<%=filename%>?page=<%=CurrentPage+1%>">下一页</a> 
                    <a href="<%=filename%>?page=<%=n%>">最后一页</a> 
                    <%End If%>
                    共<%=totalnumber%>个网站 页次:<%=CurrentPage%>/<%=n%>页</td>
                </tr>
              </table>
<%
End Function
rs.close
set rs = nothing
%>
            </td>
          </tr>
          <tr> 
            <td height="20"> </td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
</body>
</html>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -