<%
Application. Lock
If not isArray (Application ("lastTen") THEN
DIM dummy (10, 3)
Application ("lastTen") = dummy
'Create or retrieve the last 10 Application arrays.
END IF
LastTen = Application ("lastTen ")
Application. UnLock
IF lastTen (9, 0) <> "THEN
FOR I = 0 TO 9
LastTen (I, 0) = lastTen (I + 1, 0)
LastTen (I, 1) = lastTen (I + 1, 1)
LastTen (I, 2) = lastTen (I + 1, 2)
'Move each visitor down in the array.
NEXT
END IF
FOR I = 0 TO 9
'Add a new array.
IF lastTen (I, 0) = "" THEN
LastTen (I, 0) = Request. ServerVariables ("REMOTE_ADDR ")
LastTen (I, 1) = Request. ServerVariables ("HTTP_USER_AGENT ")
LastTen (I, 2) = NOW ()
EXIT
END IF
NEXT
Application. Lock
Application ("lastTen") = lastTen
Application. UnLock
%>
<Center>
<Table bgcolor = "# ccccc" cellspacing = 0 cellpadding = 3 border = 1>
<Tr bgcolor = "lightyellow">
<Td> visitors </td>
<Td> ip address </td>
<Td> browser </td>
<Td> access time </td>
'Display the last 10 visitors.
</Tr>
<%
FOR I = 0 TO 9
IF lastTen (I, 0) <> "THEN
%>
<Tr>
<Td> <small> <% = I + 1%> </small> </td>
<Td> <small> <% = lastTen (I, 0) %> </small> </td>
<Td> <small> <% = lastTen (I, 1) %> </small> </td>
<Td> <small> <% = lastTen (I, 2) %> </small> </td>
</Tr>
<%
END IF
NEXT
%>
</Table>
[1]