如何編寫(xiě)TOP 10之類(lèi)的排行榜?
<% @ LANGUAGE="VBscript" %>
<% OPTION EXPLICIT %>
<!--#include file="DataConn.asp"-->
<!--#include file="FuncSet.asp"-->
<% dim rs,sql,IDa,IDb,s,RegUser,a,b,c
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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">網(wǎng)名</font></td>
<td width="17%" class="Listline" align="center"><font color="#0000A0">帖數(shù)</font></td>
<td width="17%" align="center"><font color="#0000A0">名次</font></td>
<td width="17%" class="Listline" align="center"><font color="#0000A0">網(wǎng)名</font></td>
<td width="17%" class="Listline" align="center"><font color="#0000A0">帖數(shù)</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"><%=IDa%></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"><%=IDb%></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]
欄 目:編程問(wèn)答
本文標(biāo)題:如何編寫(xiě)TOP 10之類(lèi)的排行榜?
本文地址:http://mengdiqiu.com.cn/a1/bianchengwenda/12041.html
您可能感興趣的文章
- 01-11如何實(shí)現(xiàn)點(diǎn)擊數(shù)的計(jì)算?
- 01-11如何判斷電子郵件的地址格式是否正確?
- 01-11如何做一個(gè)文本搜索?
- 01-11如何實(shí)現(xiàn)網(wǎng)上考試?
- 01-11如何實(shí)現(xiàn)全文檢索?
- 01-11如何用POP3接收電子郵件?
- 01-11如何使用表單發(fā)送電子郵件?
- 01-11如何在線更改密碼?
- 01-11如何取回已忘記的密碼?
- 01-11如何做一個(gè)隨機(jī)密碼產(chǎn)生器?


閱讀排行
- 1C語(yǔ)言 while語(yǔ)句的用法詳解
- 2java 實(shí)現(xiàn)簡(jiǎn)單圣誕樹(shù)的示例代碼(圣誕
- 3利用C語(yǔ)言實(shí)現(xiàn)“百馬百擔(dān)”問(wèn)題方法
- 4C語(yǔ)言中計(jì)算正弦的相關(guān)函數(shù)總結(jié)
- 5c語(yǔ)言計(jì)算三角形面積代碼
- 6什么是 WSH(腳本宿主)的詳細(xì)解釋
- 7C++ 中隨機(jī)函數(shù)random函數(shù)的使用方法
- 8正則表達(dá)式匹配各種特殊字符
- 9C語(yǔ)言十進(jìn)制轉(zhuǎn)二進(jìn)制代碼實(shí)例
- 10C語(yǔ)言查找數(shù)組里數(shù)字重復(fù)次數(shù)的方法
本欄相關(guān)
- 01-11如何實(shí)現(xiàn)點(diǎn)擊數(shù)的計(jì)算?
- 01-11如何做一個(gè)文本搜索?
- 01-11如何判斷電子郵件的地址格式是否正
- 01-11如何實(shí)現(xiàn)全文檢索?
- 01-11如何實(shí)現(xiàn)網(wǎng)上考試?
- 01-11如何使用表單發(fā)送電子郵件?
- 01-11如何用POP3接收電子郵件?
- 01-11如何取回已忘記的密碼?
- 01-11如何在線更改密碼?
- 01-11如何做一個(gè)隨機(jī)密碼產(chǎn)生器?
隨機(jī)閱讀
- 01-10SublimeText編譯C開(kāi)發(fā)環(huán)境設(shè)置
- 01-10使用C語(yǔ)言求解撲克牌的順子及n個(gè)骰子
- 08-05DEDE織夢(mèng)data目錄下的sessions文件夾有什
- 01-11ajax實(shí)現(xiàn)頁(yè)面的局部加載
- 08-05dedecms(織夢(mèng))副欄目數(shù)量限制代碼修改
- 01-11Mac OSX 打開(kāi)原生自帶讀寫(xiě)NTFS功能(圖文
- 04-02jquery與jsp,用jquery
- 01-10C#中split用法實(shí)例總結(jié)
- 08-05織夢(mèng)dedecms什么時(shí)候用欄目交叉功能?
- 01-10delphi制作wav文件的方法