Web site online Counting statistics The inexplicable change is very big related problems,

Source: Internet
Author: User
Tags apache log
Website online counting statistic data inexplicable become a big problem, online and so on!
You are the first

$sql 2= "UPDATE Tongji SET hit=hit+1 where id=1";
$db->query ($sql 2);
$sql 3= "Select hits from Tongji where id=1";
$res 3= $db->query ($sql 3);
$row 3= $db->getarray ($res 3);
echo $row 3[' hit '];
?>
-Visitor
This is the homepage section of code as above, the problem is as follows:
For example, I have half an hour to log on when the data in the database is 11100, the page display is 11100, and half an hour after the refresh time can reach 11500 (sometimes larger than this change), and this half-hour time up to 10 users visited the home page. The main page is just a jump page. Excuse me, what is the reason, how to solve? Please expert guidance!


------Solution--------------------
Homepage has been visited many times ah, you use what method to determine this half an hour up to 10 users visited the homepage, perhaps more, even if you can determine, also can not deny that each user only visit once, LZ think twice!
------Solution--------------------
The relationship between UV and PV, you record the number of visits, that is, PV, and you need a UV, that is, the number of users to access, you need to use IP judgment
------Solution--------------------
JS code or what code is not a problem ... For example, repeated refresh of the page. or the code is written in a loop.
Explore

However, after I opened the page, not to any sub-page, immediately refreshed, incredibly a bit on add twenty or thirty.

------Solution--------------------
First rule out if Spider-Man is in the hair, look at Apache log content
  • 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.