Ask for a counter code

Source: Internet
Author: User
PHP Refresh plus a code

You are the No. 4873 visitor today, there are 346,456 visitors yesterday! Similar to this, refresh today's value plus 1 or 2, 3 can be, every night in the morning to clear zero, automatically in the new start. Online to find a better, can not be used, and some can use but do not know how his cont.php inside of the things are how to write. There is no full download available.


Reply to discussion (solution)


This makes a database simple +1 .... It's easy to read your own books.

Through session save with user records, directly to the database, to 12 o'clock in the morning, clear session, re-record the second day of the number of landings. This can not be satisfied, the number of visitors yesterday? Not also can satisfy, how many visitors are you?

Counter +1 can not record yesterday's, 2 floor of the convenience to say details?

Counter +1 can not record yesterday's, 2 floor of the convenience to say details?

Can't record yesterday's .... If you need a complete record then you need to have a detail table. Insert each record into the database time IP and then do a statistical display of the time according to the timestamp to display

To put it simply, the database builds the Memory table clicks,2 fields A,unique B, where a field is used for statistics, and the B field represents the 0 points of the day

PHP is updated with the following SQL statement
INSERT into clicks (b, a) VALUES (' 0 points of the day ', 1) on DUPLICATE KEY UPDATE a=a+1;

  • 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.