如何编写TOP10之类的排行榜?
来源:asp之家 发布时间:2009-11-07 18:45:00
下面我们以论坛排行榜举例说明:
<% @ 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>TOP10 排行榜 asp例子 - asp之家</title>
</head>
<body class="detail">
<table border="0" width="70%" cellpadding="0" align="center">
<tr>
<td width="16%" bgcolor="#FFFFFF" 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%" bgcolor="#FFFFFF" 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%" bgcolor="#FFFFFF" 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%" bgcolor="#FFFFFF" 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>


猜你喜欢
- PHP异步调用实现方式 浏览器和服务器之间只一种面向无连接的HTTP协议进行通讯的,面向无连接的程序的特点是客户端请求服务端,服务端根据请求
- 说明1、模型集成是指将一系列不同模型的预测结果集成在一起,从而获得更好的预测结果。2、对于模型集成来说,模型的多样性非常重要。Diversi
- C#连接数据库:Connection对象1.Connection对象概述Connection对象是一个连接对象,主要功能是建立与物理数据库的
- 一、正则表达式的作用提示:正则表达式是一段特殊的字符串,它表示的是一段有规律的信息。如果我们想从一段文字中提取想要的内容,就可以通过正则表达
- 将一个列表传入函数后,会对这个列表本身产生什么改变?这就是本文主要考察的内容。list = [1,2,3,4,5,6,7]word = li
- python用正则表达式提取中文Python re正则匹配中文,其实非常简单,把中文的unicode字符串转换成utf-8格式就可以了,然后
- js原生方法map实现<!DOCTYPE html><html lang="en"><he
- numpy.linalg.norm函数的使用1、linalg = linear(线性)+ algebra(代数),norm则表示范数。首先需
- 前言:微信H5项目,ios端出现了软键盘输完隐藏后页面不会回弹,下方会有一大块留白最近微信和ios都有版本升级,不知道是哪边升级造成的,但是
- 在封装自己的FileSystemObject库的时候,测试的时候发现在文件夹或文件很多的时候,效率很低,显示一个文件夹需要2秒甚至更多,这让
- 如下所示:# -*- coding: utf-8 -*-# @Time : 2018/5/17 15:05# @Author :
- 1、需要模块以及测试工具模块名:pyserial使用命令下载:python -m pip install pyserial串口调试工具:ss
- 在Python中处理异常使用的是try-except代码块,try-except代码块放入让python执行的操作,同时告诉python程序
- 防止客户机的请求互相干扰或者服务器与维护程序相互干扰的方法主要有多种。如果你关闭数据库,就可以保证服务器和myisamchk和isamchk
- RIFF file formatRIFF全称为资源互换文件格式(Resources Interchange File Format),是Wi
- 内容摘要:MySQL易学易用,附带丰富的技术文档,这两个因素使之被广泛应用。然而,随着MySQL发展加快,即使一个MySQL老手有时也会为该
- 在Python中,当我们有两个字典需要合并的时候,可以使用字典的 update 方法,例如:a = {'a': 1,
- 背景:pony是公司的首席体验官、首席产品经理。这次在产品峰会上pony将自己平时经验的积累与大家交流,体验较细。这次分享研发管理部,设计中
- 四则运算表达式求值思路说明使用双栈来实现——存放数值的栈 nums 与存放运算符
- 今天给vscode配置git的时候,差点没把我送走,我在配置git项目的时候会,看了一个博客文章的教学,其中配置路径的方法如下1. 在git