How to use ASP to write the website statistic System (i) (Transfer from Gaoshan)

Source: Internet
Author: User
Tags date
Statistics how to write the website statistic system with ASP (I.)

In the current Web site statistics System is most of the CGI, but the writing is particularly complex, and the ASP to learn simple, more and the advantages of combining the database, so the combination of their own has done the site statistics system, and we discuss the ASP to write a Web site statistics system.

We have seen NetEase's website statistics system, it can statistics total traffic, the average daily traffic, the day visits, the highest traffic, the highest access date, daily traffic analysis, monthly traffic analysis, weekly flow analysis, browser analysis, and so on.

In fact, to do an ASP access statistics system is the key to the system table structure design. And how to capture the user's CGI variables, and how to display the user's information. In other words, the key of the system is two ASP programs, statistical programs and display programs.

First we look at how to capture the user's access information.

We write access statistics need to know the users of the following information, the visitor's IP (according to the Access IP can form a visitor IP list), the visitor's browser and operating system (statistics visitor's browser and operating system and all visitors browser and operating system scale map), visitor's visit time (Carry on daily traffic analysis, Monthly traffic analysis, weekly traffic analysis), below we look at the use of ASP to obtain the above information statements:
1. Get Visitor IP
Dim m_ip
M_ip=request.servervariables ("Remote_host")
Use the above statement to get the IP of the visitor.
2. Get browser information
Dim O_browser,m_browsertype
Set o_browser=server.createobject ("MSWC. BrowserType ")
M_browsertype=o_browser.browser+o_browser.version
3. Get access Time
Dim M_datetime
M_datetime=year (Date ()) & "/" &right ("0" &month (date ()), 2) & "/" Right ("0" &day (date ()), 2) & "/" &right ("0" &hour (Time ()), 2) & ":" &right ("0" &minute (Time ()), 2) & ":" &right ("0" & Second (Time ()), 2



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.