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

📄 list.asp

📁 在线交友模块:在线交友是指通过网络来结交朋友。利用网络资源的无限性实现跨地域的信息交流
💻 ASP
字号:
<%
Option Explicit
dim conn,DBPath
dim rs_lar
dim px,sql,search_txt,str
dim s_netname,s_sex,s_britherday,s_netcall,s_ip,s_renqi,s_home,s_date
dim j_netname,j_sex,j_britherday,j_netcall,j_ip,j_renqi,j_home,j_date
dim pages,records,currentpage,linenumber,line
dim p

'判断Session变量是否超时
if isempty(session("user_id")) then
   response.redirect "timeout.htm"
end if
'-----------------------------------------------------------------
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("friend/global.asa")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
'-----------------------------------------------------------------
px=request("px"):if px="" then px="j_date"

search_txt=request("search_txt")
if instr(search_txt,"%") or instr(search_txt,"'") or instr(search_txt,"<") then
	response.write "你输入了非法字符!"
	response.end
end if

Set rs_lar = Server.CreateObject("ADODB.Recordset")

sql="select user_id,netname,sex,netcall,britherday,ip,renqi,home,date,photo from larchives"
if search_txt<>"" then
	sql=sql & " where netname like '%" & search_txt & "%'"
	sql=sql & " or sex like '%" & search_txt & "%'"
	sql=sql & " or netcall like '%" & search_txt & "%'"
	sql=sql & " or britherday like '%" & search_txt & "%'"
	sql=sql & " or ip like '%" & search_txt & "%'"
	sql=sql & " or cstr(renqi) like '" & search_txt & "'"
	sql=sql & " or date like '%" & search_txt & "%'"
	'sql=sql & " or home like '%" & search_txt & "%'"
	'sql=sql & " or photo like '%" & search_txt & "%'"
end if

Select case px
       case "s_netname"
             sql=sql & " Order by  time   asc"
       case "s_sex"
             sql=sql & " Order by  sex    asc"
       case "s_britherday"
             sql=sql & " Order by  britherday    asc"
       case "s_netcall"
             sql=sql & " Order by  netcall asc"
       case "s_ip"
             sql=sql & " Order by  ip      asc"
       case "s_renqi"
             sql=sql & " Order by  renqi   asc"
       case "s_home"
             'sql=sql & " Order by home asc"
       case "s_date"
             sql=sql & " Order by date     asc"

       case "j_netname"
             sql=sql & " Order by  name   desc"
       case "j_sex"
             sql=sql & " Order by  sex    desc"
       case "j_britherday"
             sql=sql & " Order by  britherday    desc"
       case "j_netcall"
             sql=sql & " Order by netcall desc"
       case "j_ip"
             sql=sql & " Order by  ip     desc"
       case "j_renqi"
             sql=sql & " Order by  renqi  desc"
       case "j_home"
             'sql=sql & " Order by home    desc"
       case "j_date"
             sql=sql & " Order by time    desc"
       case "j_photo"
             sql=sql & " Order by photo    desc"
End Select
rs_lar.open sql,conn,3,2
if rs_lar.eof and rs_lar.bof then str="此交友系统还没有一个网友!"

'分页设置
if str="" then
	rs_lar.PageSize=15
	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
%>
<html>
<head>



<STYLE type=text/css>
TD {
	FONT-SIZE: 12px; COLOR: #800000; LINE-HEIGHT: 14pt
}

A {
	FONT-SIZE: 9pt; COLOR: ff0000; TEXT-DECORATION: none
}
A:hover {
	COLOR: #800000; TEXT-DECORATION: underline
}
.put {
	BORDER-RIGHT: #f7e0e0 1px solid; BORDER-TOP: #f7e0e0 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #f7e0e0 1px solid; COLOR: #000000; BORDER-BOTTOM: #f7e0e0 1px solid; BACKGROUND-COLOR: #fef7f7
}
BODY {
	SCROLLBAR-FACE-COLOR: #ee9999; SCROLLBAR-HIGHLIGHT-COLOR: #fef7f7; SCROLLBAR-SHADOW-COLOR: #fef7f7; SCROLLBAR-3DLIGHT-COLOR: #fef7f7; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #fef7f7; SCROLLBAR-DARKSHADOW-COLOR: #fef7f7
}
</STYLE>
<title>我爱我网交友中心---网友总览</title>
</head>
<body topmargin="0" bgcolor="#fef7f7">
<!--#include file=top.asp -->
  <table border="0" width="750">
    <tr>
      <td width="578" align="center" style="border-bottom-style: solid; border-bottom-width: 1">
      <p align="left">
      <font size="2"><%if search_txt<>"" then%>以下是包含关键字<font color="#ff0000"><%=search_txt%></font>的所有网友<%else%>以下是所有网友的列表<%end if%></font>
      </p>
      </td>
    </tr>
    <tr>
      <td width="578">
      <font size="2">第<font color="red"><%=currentpage%></font>页&nbsp;<%if search_txt="" then%>已加入网友共<%else%>找到网友<%end if%><font color="blue"><%=Records%></font>位&nbsp;共<font color="blue"><%=Pages%></font>页</font>
      </td>
    </tr>
    <tr>
      <%if pages>1 then%>
      <td width="578">
      <font size="2"><i>转到页码:[
      <%for p=1 to pages%>
      <a <%if currentpage=p then%> style="color:red"<%end if%> href="list.asp?currentpage=<%=p%>&search_txt=<%=search_txt%>&px=<%=px%>"><%=p%></a>
      <%if p/30=0 then%>
      <%end if%>
      <%next%>
      ]</i></font>
      </td>
      <%end if%>
    </tr>
  </table>
  <!------------------------------------------------------------------------------------------------------------------------->
    <table border="0" width="750" cellspacing="0">
       <tr>
        <td width="87" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">网名<a title="按网名升序排列" <%if px="s_netname" then%> style="color:red"<%end if%> href="list.asp?px=s_netname&search_txt=<%=search_txt%>">↑</a><a title="按网名降序排列" <%if px="j_netname" then%> style="color:red"<%end if%> href="list.asp?px=j_netname&search_txt=<%=search_txt%>">↓</a></font></td>
        <td width="60" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">性别<a title="按性别升序排列" <%if px="s_sex" then%> style="color:red"<%end if%> href="list.asp?px=s_sex&search_txt=<%=search_txt%>">↑</a><a title="按性别降序排列" <%if px="j_sex" then%> style="color:red"<%end if%> href="list.asp?px=j_sex&search_txt=<%=search_txt%>">↓</a></font></td>
        <td width="116" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">来自<a title="按籍贯升序排列" <%if px="s_home" then%> style="color:red"<%end if%> href="list.asp?px=s_home&search_txt=<%=search_txt%>">↑</a><a title="按籍贯降序排列" <%if px="j_home" then%> style="color:red"<%end if%> href="list.asp?px=j_home&search_txt=<%=search_txt%>">↓</a></font></td>
        <td width="80" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">生日<a title="按生日升序排列" <%if px="s_britherday" then%> style="color:red"<%end if%> href="list.asp?px=s_britherday&search_txt=<%=search_txt%>">↑</a><a title="按生日降序排列" <%if px="j_britherday" then%> style="color:red"<%end if%> href="list.asp?px=j_britherday&search_txt=<%=search_txt%>">↓</a></font></td>
        <td width="99" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">网络寻呼机<a title="按网络传呼机号码升序排列" <%if px="s_netcall" then%> style="color:red"<%end if%> href="list.asp?px=s_netcall&search_txt=<%=search_txt%>">↑</a><a title="按网络传呼机号码降序排列" <%if px="j_netcall" then%> style="color:red"<%end if%> href="list.asp?px=j_netcall&search_txt=<%=search_txt%>">↓</a></font></td>
        <td width="110" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">登记IP<a title="按登记IP升序排列" <%if px="s_ip" then%> style="color:red"<%end if%> href="list.asp?px=s_ip&search_txt=<%=search_txt%>">↑</a><a title="按登记IP降序排列" <%if px="j_ip" then%> style="color:red"<%end if%> href="list.asp?px=j_ip&search_txt=<%=search_txt%>">↓</a></font></td>
        <td width="81" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">登记时间<a title="按登记时间升序排列" <%if px="s_date" then%> style="color:red"<%end if%> href="list.asp?px=s_date&search_txt=<%=search_txt%>">↑</a><a title="按登记时间降序排列" <%if px="j_date" then%> style="color:red"<%end if%> href="list.asp?px=j_date&search_txt=<%=search_txt%>">↓</a></font></td>
        <td width="69" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">人气<a title="按人气升序排列" <%if px="s_renqi" then%> style="color:red"<%end if%> href="list.asp?px=s_renqi&search_txt=<%=search_txt%>">↑</a><a title="按人气降序排列" <%if px="j_renqi" then%> style="color:red"<%end if%> href="list.asp?px=j_renqi&search_txt=<%=search_txt%>">↓</a></font></td>
      
<td width="69" align="center" bgcolor="#000000" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><font color="#FFFFFF">照片数<a title="按照片数升序排列" <%if px="s_photo" then%> style="color:red"<%end if%> href="list.asp?px=s_photo&search_txt=<%=search_txt%>">↑</a><a title="按照片数降序排列" <%if px="j_photo" then%> style="color:red"<%end if%> href="list.asp?px=j_photo&search_txt=<%=search_txt%>">↓</a></font></td>
      
</tr>
      <%linenumber=rs_lar.pagesize%>
      <%do while (not rs_lar.eof) and (line<linenumber)%>
      <tr>
        <td width="87" align="center" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><a href="read.asp?user_id=<%=rs_lar("user_id")%>" title="查看网友<%=rs_lar("netname")%>的祥细资料"><%=rs_lar("netname")%></a></td>
        <td width="60" align="center" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><%=rs_lar("sex")%></td>
        <td width="116" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><%=rs_lar("home")%></td>
        <td width="80" align="center" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><%=rs_lar("britherday")%></td>
        <td width="99" align="center" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><%=rs_lar("netcall")%></td>
        <td width="110" align="center" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><%=rs_lar("ip")%></td>
        <td width="81" align="center" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><%=rs_lar("date")%></td>
        <td width="69" align="center" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><%=rs_lar("renqi")%></td>
             <td width="69" align="center" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000" bgcolor="#EEEEEE"><%=rs_lar("photo")%></td> 

</tr>
      <%rs_lar.movenext%>
      <%line=line+1%>
      <%loop%>
    </table>
  <!-------------------------------------分页导航--------------------------------------->
  <table width="750">
    <tr>
      <td>
      <font size="2">
      <%if currentpage>1 then%>
      <a href="list.asp?currentpage=<%=currentpage-1%>&search_txt=<%=search_txt%>&px=<%=px%>"><font size="2">[上一页]</font></a>
      <%end if%>
      <%if currentpage<pages then%>
      <a href="list.asp?currentpage=<%=currentpage+1%>&search_txt=<%=search_txt%>&px=<%=px%>">[下一页]</a>
      <%end if%>
      <%if currentpage>1 then%>
      <a href="list.asp?currentpage=1&search_txt=<%=search_txt%>&px=<%=px%>">[最首页]</a>
      <%end if%>
      <%if currentpage<pages then%>
      <a href="list.asp?currentpage=<%=pages%>&search_txt=<%=search_txt%>&px=<%=px%>">[最末页]</a>
      <%end if%>
      </font>
      </td>
    </tr>
  </table>
  <!-------------------------------------------------------------------------------------------------------------------------><!------------------------------------------------------------------------------------------------------------------------->
<form>
  <table border="0" width="100%" cellspacing="0" height="27">
    <tr>
      <td width="100%" height="13">
      <p align="center">
      搜索关键字<input class=put type="text" name="search_txt" size="8" value="<%=search_txt%>">&nbsp;<input type="submit" class=put value="搜索" name="B1"><a href="file:///C:/My%20Documents/My%20Webs/no.htm">[高级搜索]</a>
      </p>
      </td>
   </tr>
    <tr>
      <td width="100%" height="12">
      <p align="center">关键字为空列出所有网友
      </td>
    </tr>
  </table>
</form>

<!--#include file=CopyRight.asp -->
</body>
</html>
<%rs_lar.close:set rs_lar=nothing:set conn=nothing%>

⌨️ 快捷键说明

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