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

📄 searchatc.asp

📁 大家好
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%
'response.write vartype(year(now))&"<br>"
'response.write vartype(month(now))&"<br>"
'response.write vartype(day(now))
session("sql")=""

set conn=server.createObject("ADODB.Connection")
	dbpath=server.mappath("club.mdb")
	conn.open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbpath
	set rs=server.createobject("ADODB.Recordset")

   
   sqlText="select boardid,boardname from board_info"
   rs.open sqltext,conn,1
   if rs.eof and rs.bof then
  rs.close
  conn.close
  set rs=nothing
  set conn=nothing
  response.write "no lanmu!"
  response.end  
else
total=rs.recordcount
%>
<html>

<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.botton {  font-size: 12px; color: #000000; background-color: #FFFFF8}
-->
</style>
<link rel="stylesheet" href="club.css">
<script>
<!--
function checkdate(form)
{
checkyear=form.year.value
checkmonth=form.month.value
checkday=form.day.value
if(checkday==31&&(checkmonth==4||checkmonth==6||checkmonth==9||checkmonth==10))
	{
		alert("对不起,"+checkmonth+"月份只有30天!")
		form.day.value=30;
		form.day.focus();
	}
if(checkmonth==2)
{
	if(checkday>29&&((checkyear%4==0&&checkyear%100!=0)||checkyear%400==0)){
			alert(checkyear+"年2月份只有29天!");
			form.day.value=29;
			form.day.focus();}
	if(checkday>28&&!((checkyear%4==0&&checkyear%100!=0)||checkyear%400==0)){
			alert("2月份只有28天!");
			form.day.value=28;
			form.day.focus();}
}
}
//-->
</script>
</head>

<body bgcolor="#FFFFF8">
<form method="post" action="searchatcact.asp" name>
  <table width="75%" border="1" align="center" cellspacing="0" cellpadding="3"
  bordercolorlight="#000000" bordercolordark="#FFFFFF">
    <tr align="left" valign="middle"> 
      <td colspan="2" bgcolor="#DDDFFF"> 〖贴子查询〗 </td>
    </tr>
    <tr> 
      <td width="17%" bgcolor="#DDDFFF" align="right"> 发布者</td>
      <td width="83%" bgcolor="#DBF1F2"> 
        <input type="text" name="guestname" size="20" class="botton">
      </td>
    </tr>
    <tr> 
      <td height="26" width="17%" bgcolor="#DDDFFF" align="right"> 版面</td>
      <td height="26" width="83%" bgcolor="#DBF1F2"> 
        <select name="boardid" size="1" class="botton">
          <option value="" selected>不知道</option>
          <%
for i=1 to total
    response.write "<option value='"&rs("boardid")&"'>"&rs("boardname")&"</option>"
    rs.movenext
    if rs.eof then
	    exit for
    end if
next
    rs.close
	conn.close
	set rs=nothing
	set conn=nothing
end if%> 
        </select>
      </td>
    </tr>
    <tr> 
      <td height="24" width="17%" bgcolor="#DDDFFF" align="right">发布时间</td>
      <td height="24" width="83%" bgcolor="#DBF1F2"> 
        <input type="radio" name="t1" value="0" checked>
        大于 
        <input type="radio" name="t1" value="1">
        等于 
        <input type="radio" name="t1" value="2">
        小于 
        <select name="year" size="1" class="botton" onchange="checkdate(this.form)">
<%for a=1995 to 2005%>
          <option value="<%=a%>"<%if a=year(now) then%> selected<%end if%>><%=a%></option>
<%next%>
        </select>
        <select name="month" size="1" class="botton" onchange="checkdate(this.form)">
<%
for i=1 to 12%>
          <option value="<%=i%>"<%if i=month(now) then%> selected<%end if%>><%=i%></option>
<%next%>
        </select>
        <select name="day" size="1" class="botton" onchange="checkdate(this.form)">
<%for l=1 to 31%>
          <option value="<%=l%>"<%if l=day(now) then%> selected<%end if%>><%=l%></option>
<%next%>
        </select>
        日 </td>
    </tr>
    <tr> 
      <td width="17%" bgcolor="#DDDFFF" height="35" align="right"> 贴子主题</td>
      <td width="83%" bgcolor="#DBF1F2" height="35"> 
        <input type="text" name="title" size="20" class="botton">
        关键字模糊查询</td>
    </tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Submit" value="查  找" class="botton">
</td>
</tr>
</table>
  <p align="center">(*查询后如果要更改查询条件需要从查询显示页返回不能按后退返回!*)</p>
</form>
</body>
</html>

⌨️ 快捷键说明

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