当前位置: 首页 > 图文教程 > 网络编程 > 编程10000问 > 如何编写TOP 10之类的排行榜?

编程10000问
如何获知文件被改动的情况?
如何获知文件最后的修改日期和时间?
如何在线查询本地机的文件?
如何制作一个文本文件编辑器?
如何简单地上传文件?
如何上传一个单纯的HTML文件?
如何实现文件上传并自动归类功能?
如何实现无组件上传二进制文件?
在无组件的情况下,如何上传图片?
如何限制上传文件的大小?
如何用拦截表单的方法上传图片?
如何对用户进行授权?
如何更好地保护我的网页?
如何实现某些页面只让特定的用户浏览?
如何实现某一页面只让特定的用户浏览?
如何实现强制登录?
如何制作一个安全的页面?
如何最大限度地实现安全登录功能?
如何防止未经注册的用户绕过注册界面直接进入应用系统?
怎样避免直接在地址栏敲入URL即可绕过登录页的错误?

编程10000问 中的 如何编写TOP 10之类的排行榜?


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-10   浏览: 34 ::
收藏到网摘: n/a

<% @ LANGUAGE="VBscript" %>

<% OPTION EXPLICIT %>

<!--#include file="DataConn.asp"-->

<!--#include file="FuncSet.asp"-->

<% dim rs,sql,IDa,IDb,s,RegUser,a,b,c

Set rs=Server.CreateObject("ADODB.recordset")

sql="Select * from UserInfo ORDER BY iPerience DESC"

rs.Open sql,ConnStr,1,1

RegUser=rs.RecordCount

IDa=1

IDb=2

%>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<meta http-equiv="pragma" content="no-cache">

<link rel="stylesheet" type="text/css" href="Site.css">

<title>山水盈盈之论坛大英雄</title>

</head>

<body class="detail">

<table border="0" width="70%" cellpadding="0" align="center">

<tr>

<td width="16%" align="center"><font color="#0000A0">名次</font></td>

<td width="16%" class="Listline" align="center"><font color="#0000A0">网名</font></td>

<td width="17%" class="Listline" align="center"><font color="#0000A0">帖数</font></td>

<td width="17%" align="center"><font color="#0000A0">名次</font></td>

<td width="17%" class="Listline" align="center"><font color="#0000A0">网名</font></td>

<td width="17%" class="Listline" align="center"><font color="#0000A0">帖数</font></td>

</tr>

<% if RegUser<10 then

a=RegUser/2

else

a=5

end if

for s=1 to a

%>

<tr>

<td width="16%" align="center" valign="bottom"><font size="2"

color="#0000A0"><b><%=IDa%></b></font> </td>

<td class="Listline" align="center" style="cursor:hand" onmouseup="window.open('UserInfo.asp?UserName=<%=rs("UserName")%>','Call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000CC><%=rs("UserName")%></font></td>

<td class="Listline" align="center"><%=rs("iPerience")%></td>

</td>

<%rs.movenext%>

<td width="17%" align="center" valign="bottom"><font size="2"

color="#0000A0"><b><%=IDb%></b></font> </td>

<td class="Listline" align="center" style="cursor:hand" onmouseup="window.open('UserInfo.asp?UserName=<%=rs("UserName")%>','Call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000CC><%=rs("UserName")%></font></td>

<td class="Listline" align="center"><%=rs("iPerience")%></td>

</tr>

<%

IDa=IDa+2

IDb=IDb+2

rs.movenext

next

%>

<% if RegUser>20 then

for b=11 to 15 %>

<td class="Listline" align="center" style="cursor:hand" onmouseup="window.open('UserInfo.asp?UserName=<%=rs("UserName")%>','Call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000CC><%=rs("UserName")%></font></td>

<% rs.movenext%>

<%

next

end if %>

<% if RegUser>20 then

for c=16 to 20 %>

<td class="Listline" align="center" style="cursor:hand" onmouseup="window.open('UserInfo.asp?UserName=<%=rs("UserName")%>','Call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000CC><%=rs("UserName")%></font></td>

<% rs.movenext%>

<%

next

end if %>

</table>

</body></html>

[1]