顯示|線上 原作者:東子
在你要再線人數顯示的地方的頁首添加
<%@ Language=VBScript %>
<% Option Explicit %>
在你要再線人數顯示的地方
<!-- #include file="show_count.asp" -->
詳細列表
<!-- #include file="show_users.asp" -->
這裡是show_users.asp的原程式
<%
If rstActiveUsers.RecordCount > 0 Then
rstActiveUsers.MoveFirst
Response.Write "<table border=""1"">" & vbCrLf
Response.Write " <thead>" & vbCrLf
Response.Write " <th>Session Id</td>" & vbCrLf
Response.Write " <th>IP Address</th>" & vbCrLf
Response.Write " <th>User Agent</th>" & vbCrLf
Response.Write " <th>Session Start Time</th>" & vbCrLf
Response.Write " </thead>" & vbCrLf
Do While Not rstActiveUsers.EOF
Response.Write " <tr>" & vbCrLf
Response.Write " <td>" & rstActiveUsers.Fields("id").Value & "</td>" & vbCrLf
Response.Write " <td>" & rstActiveUsers.Fields("ip").Value & "</td>" & vbCrLf
Response.Write " <td>" & rstActiveUsers.Fields("browser").Value & "</td>" & vbCrLf
Response.Write " <td>" & rstActiveUsers.Fields("started").Value & "</td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
rstActiveUsers.MoveNext
Loop
Response.Write "</table>" & vbCrLf
End If
%>
這裡是show_count.asp的原程式
<b><font color="#CC0000"><%= rstActiveUsers.RecordCount %></font> 線上使用者</b>