How to use ASP to write the website statistic System (i) (Transfer from Gaoshan)
Source: Internet
Author: User
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.
everybody has seen NetEase's website statistic system, it can statistic total visit amount, daily average visit amount, day visit quantity, maximum visit quantity, highest visit date, daily flow analysis, monthly flow analysis, week flow analysis, browser analysis, etc.
actually want to do an ASP access statistics system is the key to the design of the system table structure. 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 let's look at how to capture the user's access information.
We write access statistics need to know the user's following information, the visitor's IP (can form the visitor IP list according to the access IP), the visitor's browser and the operating system (statistics visitor's browser and the operating system and all visitor browser and operating system scale chart), Visitors ' access time (for daily traffic analysis, monthly traffic analysis, weekly traffic analysis), below we take a look at the use of ASP to obtain the above information statement:
1. Get the 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
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