How to use ASP to write the website Statistic system (IV.)

Source: Internet
Author: User
This article only makes the method discussion.
-----------------

Can collect the data we all can gather, then we begin to compile the ASP the statistic page.
This page we call the Count page, counter.asp
This ASP code we need to get it to collect data and save data and update data according to the following process:
Collect the username, judge whether the user name is legitimate, collect the visitor's information, process the information, save and update the database, and return the logo icon.
Call this ASP using COUNTER.ASP?USER=ABC this way.
Acquisition of user name we can use the corresponding method of the request object to obtain, and then check the user table to determine whether the user is legitimate, and then take the information, we mentioned above to obtain the appropriate information methods to obtain information, and then processed in the data table, but the most important is how to update the data, How do we update our daily data, such as hourly statistics, hourly statistics, and so on, we can take several ways, such as updating our records every hour of the day and we take them 12 o'clock every day at midnight, For each of the monthly data we update on the day of the month switch.

Third, we speak of the table structure value_table table wrong, this time to modify:

Value_table

Username C
ID C
Value I
DateTime c

Let me talk about the specific process, by month statistics Example:
1, to arrive at the date and time of the last statistic
2, the current date and time, the current month and converted to the corresponding ID
3, to determine whether the current month is the same as the previous month, if the same is to add 1 to the total, the current month's ID cumulative 1, if not the same clear zero
All month IDs, add 1 to the total ID only
4, according to the monthly statistics we can do the hour statistics, weekly statistics, day statistics.
We can do the statistics page according to the process as above, pay attention to the distribution of each ID to classify clearly the meaning of the representative should be clear.



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.