vlogsearch.asp
来自「ASP入门与提高实用教程 源文件(上传网站)」· ASP 代码 · 共 148 行
ASP
148 行
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/const.asp"-->
<%
checkadmin()
%>
<%
dim rs,sql
dim yy,mm,dd,i
dim ID,opts,multi
yy=encodestr(request("myear"))
mm=encodestr(request("mymonth"))
ID=encodestr(request("ID"))
opts=encodestr(request("opts"))
multi=encodestr(request("multi"))
if multi="" then multi=-1
if yy="" then yy=0
if mm="" then mm=0
set rs= Server.CreateObject("Adodb.recordset")
%>
<!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">
<title>无标题文档</title>
<link rel="stylesheet" href="style/3.css" type="text/css">
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
-->
</style>
</head>
<body>
<form action="Vloglist.asp" method="post" name="form1" target="_self">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5" bgcolor="#E1E1E1">
<p align="center"><font color="#003399"><b>日志查询</b></font>
</td>
</tr>
<tr>
<td width="18%" height="22"> </td>
<td width="12%">ID号</td>
<td width="52%"><input name="ID" type="text" id="ID" <%if ID<>"" then %>value="<%=ID%>"<%end if%>></td>
<td width="18%"> </td>
</tr>
<tr>
<td> </td>
<td>在</td>
<td><select name="myear" id="myear" >
<option value="0" <%if yy=0 then response.write "selected"%>>--年--</option>
<% for i=1999 to 2006
if cint(i)=cint(yy) then
response.Write("<option value="""&i&""" selected>"&i&"</option>")
else
response.Write("<option value="""&i&""">"&i&"</option>")
end if
next %>
</select>
年
<select name="mymonth" id="mymonth" onChange="javascript:window.open('?ID='+ID.value+'&myear='+myear.value+'&mymonth='+this.value,'_self')">
<option value="0" <%if mm=0 then response.write "selected"%>>--月--</option>
<% for i=1 to 12
if cint(i)=cint(mm) then
response.Write("<option value="""&i&""" selected>"&i&"</option>")
else
response.Write("<option value="""&i&""">"&i&"</option>")
end if
next %>
</select>
月
<select name="myday" id="myday">
<option value="0" selected>--日--</option>
<%
if yy<>0 and mm<>0 then
dd=checkmonth(yy,mm)
for i=1 to dd
response.Write("<option value="""&i&""">"&i&"</option>")
next
end if%>
</select>
日之后
</td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="提交"></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
<%
set rs=nothing
conn.close
set conn=nothing
function checkyear(yy)
dim m
if yy mod 400=0 then
m=1
elseif yy mod 100=0 then
m=0
elseif yy mod 4=0 then
m=1
else m=0
end if
checkyear=m
end function
function checkmonth(yy,mm)
dim dd
Select Case mm
case 1 dd=31
case 2 dd=28+checkyear(yy)
case 3 dd=31
case 4 dd=30
case 5 dd=31
case 6 dd=30
case 7 dd=31
case 8 dd=31
case 9 dd=30
case 10 dd=31
case 11 dd=30
case 12: dd=31
case else:
response.write "错误!请输入1到12之间的数字"
response.end
End Select
checkmonth=dd
end function
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?