vloglist.asp

来自「ASP入门与提高实用教程 源文件(上传网站)」· ASP 代码 · 共 59 行

ASP
59
字号
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/const.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style/2.css" type="text/css">
<title>list</title>
</head>

<body>

  <%
checkadmin()  
dim rs,sql,rs1
dim page,iPage

dim ID,stime
dim yy,mm,dd
dim qstr

ID=encodestr(request("ID"))
yy=encodestr(request("myear"))
mm=encodestr(request("mymonth"))
dd=encodestr(request("myday"))


qstr=""
qstr="id="&id
qstr=qstr&"&yy="&yy
qstr=qstr&"&mm="&mm
qstr=qstr&"&dd="&dd

if ID="" then ID=0
if yy="" then yy=0
if mm="" then mm=0
if dd="" then dd=0


if yy<>0 and mm<>0 and dd <>0 then
  stime=yy&"-"&mm&"-"&dd
else
  stime=dateadd("d",-1,now())
end if

sql="select * from votelog where votetime >= #"&stime&"#"
if ID<>0 then sql=sql&" and ID ="&ID

Set rs = Server.CreateObject("ADODB.Recordset")
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,1,1


rs.PageSize = 20  
Page = CLng(Request("Page"))   'string型转化为long型
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
If Page <> 1 Then
      Response.Write "<A HREF=Qlist.asp?vtype="&session("vtype")&"&Page=1>第一页</A>

⌨️ 快捷键说明

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