手机
当前位置:查字典教程网 >编程开发 >编程10000问 >如何编写TOP 10之类的排行榜?
如何编写TOP 10之类的排行榜?
摘要:山水盈盈之论坛大英雄名次网名帖数名次网名帖数20thenforb=11to15%>20thenforc=16to20%>[1]

<% @ LANGUAGE="VBscript" %>

<% OPTION EXPLICIT %>

<>

<>

<% 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>

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

<tr>

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

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

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

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

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

<td width="17%" 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 align="center" "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 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 align="center" "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 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 align="center" "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 align="center" "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]

【如何编写TOP 10之类的排行榜?】相关文章:

如何实现点击数的计算?

如何编制一个产生随机密码的函数?

如何限制上传文件的大小?

如何编写一个加法器?

如何编写翻页函数?

如何简单地上传文件?

如何实现强制登录?

如何制作一个安全的页面?

如何实现非大小写的替换?

如何制作关联的下拉菜单?

精品推荐
分类导航