Count how many people visit html page

MyPlanet 2003-08-23 02:13:50
I want to count how many people visit my page (html). Is it possible to do it by HTML? I think it should be done by javascript. Can someone show me some code for it. Thanks.
...全文
78 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
iinohk 2003-08-26
  • 打赏
  • 举报
回复
the best way is to use server side script such as asp/servlet to achieve your goal, however if u really wnat to use html, u may use ActiveXObject. f.y.i, u may visit

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsobjactivexobject.asp
wind0209 2003-08-25
  • 打赏
  • 举报
回复
I have no idea for this in HTML,try sth else like asp or jsp.
tsstudio 2003-08-24
  • 打赏
  • 举报
回复
u must not success if u want to do it in html page.cookis can not help u to do it.
MyPlanet 2003-08-23
  • 打赏
  • 举报
回复
I want to do it in HTML.
tuya000000 2003-08-23
  • 打赏
  • 举报
回复
Page Counter Component
The Page Counter component creates a PageCounter object that counts and displays the number of times a Web page has been opened. At regular intervals the object writes the number of hits to a text file so that in the event of a server shutdown, the data is not lost. The Page Counter component uses an internal Central Management object to record how many times each page in the application has been opened.

When an instance of the PageCounter object is created on a page by using the Server.CreateObject method, the object retrieves the current hit count for the specified Web page from the Central Management object. The object can then be manipulated with the methods it exposes.

The Page Counter component uses the following files:

File Names Description
Pagecnt.dll The Page Counter component.
Hit Count Data file The text file to which the Page Counter component saves the current hit count.


Syntax
Set oVar = Server.CreateObject( "MSWC.PageCounter" )



Parameters
oVar
Specifies the name of the PageCounter object created by the call to Server.CreateObject.
Registry Entries
The Page Counter adds the key MSWC.PageCounter to the registry when the object is compiled or registered. The key is added under HKEY_CLASSES_ROOT and contains the following named values.

Named Value Description
File_Location A string that specifies the path and filename of the Hit Count Data file. The default filename is Hitcnt.cnt. This file is located in your Windows directory.
Save_Count A DWORD that specifies the number of hits before the hit count is saved to the Hit Count Data file. Note that this is the total number of hits, not the number of hits per page. The default value is 25.


Methods
Hits Displays the number of times that a specified URL has been opened.
PageHit Increments the Hit Count.
Reset Sets the hit count for a specified page to 0.


Example
The following example uses the PageCounter object to track the number of visitors to the page and sends a special message to the one millionth visitor.

<%
Set MyPageCounter = Server.CreateObject("MSWC.PageCounter")
HitMe = MyPageCounter.Hits
If HitMe = 1000000 Then
%>
You are the lucky 1,000,000th Customer!!! <BR>
<% Else %>
Sorry, you are customer #<%= HitMe %> <BR>
<% End If %>

the codes above will only work in the "Active Server Page" and "ASP.NET"
dos2000 2003-08-23
  • 打赏
  • 举报
回复
use cookie

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧