这是表单问题的程序代码,请问高手tmp=1是什么作用呢?这种调用(seachout.asp 再调用它自己)是如何传递参数的,请高手给解释一下,多谢!
<%Option Explicit%><!--#include file="conn.asp"--><%
dim rs_lar
dim c_age,c_name,c_sex,c_netname,c_home,c_education,c_job,c_netcall,c_tel,c_book,c_music,c_sport,c_interest,c_character,c_photo
dim age1,age2,name,sex,netname,home,education,job,netcall,tel,sport,book,music,interest,character,photo
dim sql,str,hrefdate
dim pages,records,currentpage,linenumber,line,p
c_age =request("c_age")
c_name =request("c_name")
c_sex =request("c_sex")
c_netname =request("c_netname")
c_home =request("c_home")
c_education =request("c_education")
c_job =request("c_job")
c_netcall =request("c_netcall")
c_tel =request("c_tel")
c_sport =request("c_sport")
c_book =request("c_book")
c_music =request("c_music")
c_sport =request("c_sport")
c_interest =request("c_interest")
c_character =request("c_character")
c_photo =request("c_photo")
age1 =request("age1")
age2 =request("age2")
name =request("name")
sex =request("sex")
netname =request("netname")
home =request("home")
education =request("education")
job =request("job")
netcall =request("netcall")
tel =request("tel")
sport =request("sport")
book =request("book")
music =request("music")
sport =request("sport")
interest =request("interest")
character =request("character")
photo =request("photo")
Set rs_lar = Server.CreateObject("ADODB.Recordset")
hrefdate=""
sql="select * from larchives where cstr(lar_id) like '%'"
if c_age="ON" then
sql=sql & " and age>" & clng(age1) & " and age<" & clng(age2)
hrefdate=hrefdate & "&c_age=" & "ON" & "&age1=" & age1 & "age2=" & age2
end if
if c_name="ON" then
sql=sql & " and name like '" & name & "'"
hrefdate=hrefdate & "&c_age=" & "ON" & "&age1=" & age1 & "age2=" & age2
end if
if c_netname="ON" then
sql=sql & " and netname like '" & netname & "'"
hrefdate=hrefdate & "&c_netname=" & "ON" & "&netname=" & netname
end if
if c_sex="ON" then
sql=sql & " and sex like '" & sex & "'"
hrefdate=hrefdate & "&c_sex=" & "ON" & "&sex=" & sex
end if
if c_home="ON" then
sql=sql & " and home like '%" & home & "%'"
hrefdate=hrefdate & "&c_home=" & "ON" & "&home=" & home
end if
if c_education="ON" then
sql=sql & " and education like '" & education & "'"
hrefdate=hrefdate & "&c_education=" & "ON" & "&education=" & education
end if
if c_job="ON" then
sql=sql & " and job like '" & job & "'"
hrefdate=hrefdate & "&c_job=" & "ON" & "&job=" & job
end if
if c_netcall="ON" then
sql=sql & " and netcall like '%" & netcall & "%'"
hrefdate=hrefdate & "&c_netcall=" & "ON" & "&netcall=" & netcall
end if
if c_tel="ON" then
sql=sql & " and tel like '" & tel & "'"
hrefdate=hrefdate & "&c_tel=" & "ON" & "&tel=" & tel
end if
if c_sport="ON" then
sql=sql & " and sport like '%" & sport & "%'"
hrefdate=hrefdate & "&c_sport=" & "ON" & "&sport=" & sport
end if
if c_book="ON" then
sql=sql & " and book like '%" & book & "%'"
hrefdate=hrefdate & "&c_book=" & "ON" & "&book=" & book
end if
if c_music="ON" then
sql=sql & " and music like '%" & music & "%'"
hrefdate=hrefdate & "&c_music=" & "ON" & "&music=" & music
end if
if c_interest="ON" then
sql=sql & " and interest like '%" & interest & "%'"
hrefdate=hrefdate & "&c_interest=" & "ON" & "&interest=" & interest
end if
if c_character="ON" then
sql=sql & " and character like '%" & character & "%'"
hrefdate=hrefdate & "&c_character=" & "ON" & "&character=" & character
end if
if c_photo="ON" then
if photo="有" then sql=sql & " and photo>0" else sql=sql & " and photo=0"
hrefdate=hrefdate & "&c_photo=" & "ON" & "&photo=" & photo
end if
rs_lar.open sql,conn,3,2
if rs_lar.eof and rs_lar.bof then str="还没有一个会员!"
'分页设置
if str="" then
rs_lar.PageSize=20
pages=rs_lar.pagecount
records=rs_lar.recordcount
currentpage=request("currentpage")
if currentpage="" or currentpage<1 then currentpage=1
currentpage=cint(currentpage)
if currentpage>pages then currentpage=pages
rs_lar.absolutepage=currentpage
else
currentpage=1
records=0
pages=1
end if
%>
<!--#include file=top.asp -->
<table border="0" width="95%" height="28">
<tbody>
<form method=Post action="searchout.asp?tmp=1<%=hrefdate%>">
<tr>
<td colspan="2">
<img src="images/arrow.gif" width="12" height="12" align="top" border="0" hspace="5"><font class="titletext" color="#FF0099">以下是符合您搜索条件的网友</font>
</td>
</tr>
<tr>
<td>找到网友 <font color="red"><b><%=Records%></b></font> 位 页次: <font color="red"><b><%=currentpage%></b></font> / <font color="red"><b><%=Pages%></b></font> 页
</td>
<td align="right">
转到: <input type="text" name="currentpage" size=3 maxlength=6 class=put value="<%=currentpage%>"> 页
</td>
</tr>
</form>
</tbody>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td height="1" bgcolor="#FF99CC"></td>
</tr>
<tr>
<td align="center" background="images/bg2.gif">
<table border="0" cellspacing="0" width="95%">
<tbody>
<tr height="30">
<td width="19%"><font color="#FF0000">网 名</font></td>
<td width="7%" align="center"><font color="#FF0000">性别</font></td>
<td width="37%" align="center"><font color="#FF0000">所 在 地</font></td>
<td width="7%" align="center"><font color="#FF0000">年龄</font></td>
<td width="16%" align="center"><font color="#FF0000">入会日期</font></td>
<td width="7%" align="center"><font color="#FF0000">人气</font></td>
<td width="7%" align="center"><font color="#FF0000">活力</font></td>
</tr>
<%linenumber=rs_lar.pagesize%>
<%do while (not rs_lar.eof) and (line<linenumber)%>
<tr height="23">
<td width="19%"><a href="read.asp?user_id=<%=rs_lar("user_id")%>" title="查看网友<%=rs_lar("netname")%>的祥细资料"><%=rs_lar("netname")%></a></td>
<td width="7%" align="center"><%=rs_lar("sex")%></td>
<td width="37%"><%=rs_lar("home")%></td>
<td width="7%" align="center"><%=rs_lar("age")%></td>
<td width="16%" align="center"><%=rs_lar("date")%></td>
<td width="7%" align="center"><%=rs_lar("renqi")%></td>
<td width="7%" align="center"><%=rs_lar("huoli")%></td>
</tr>
<%rs_lar.movenext%>
<%line=line+1%>
<%loop%>
<%rs_lar.close%>
</tbody>
</table>
<tr>
<td height="1" background="images/hline.gif"></td>
</tr>
</tbody>
</table>
<table width="95%" height="28">
<tbody>
<tr>
<td><a href="wjxy.asp">重新搜索</a></td>
<td align="right">
<%if currentpage>1 then%>
<a href="searchout.asp?currentpage=<%=currentpage-1%><%=hrefdate%>">上一页</a>
<%end if%>
<%if currentpage<pages then%>
<a href="searchout.asp?currentpage=<%=currentpage+1%><%=hrefdate%>">下一页</a>
<%end if%>
<%if currentpage>1 then%>
<a href="searchout.asp?currentpage=1<%=hrefdate%>">首页</a>
<%end if%>
<%if currentpage<pages then%>
<a href="searchout.asp?currentpage=<%=pages%><%=hrefdate%>">末页</a>
<%end if%>
</td>
</tr>
</tbody>
</table>
<!--#include file=CopyRight.asp -->