Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8798053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:59:26+00:00 2026-06-13T23:59:26+00:00

I have a simple session-based PHP hit counter on a website. The problem is

  • 0

I have a simple session-based PHP hit counter on a website. The problem is that it seems to be adding phantom hits whenever I have the website open for some time (even without me reloading it), so I’m thinking the session timeout is set to a very short amount of time somewhere on the server. However, I have checked php.ini and the timeout is the standard 24 minutes, while phantom hits get added every three minutes or so.

The website has no nameservers pointing to it yet, nothing links to it, so it’s not an issue of robots/crawlers. Here is my code:

            $hit_file = file(__DIR__ . "/hit_file.txt");

            $hit_num = $hit_file[0];
            if(!isset($_SESSION['been']))

                {


                    $hit_num++;

                    $hit_write = fopen(__DIR__ . "/hit_file.txt", 'w');

                    fwrite($hit_write, $hit_num);

                    fclose($hit_write);

                    $_SESSION['been'] = 1;

                }

             echo $hit_num;

UPDATE: I have noticed some weird access.log entries. They all follow this format:
::1 – – [06/Nov/2012:22:05:03 +0100] “GET / HTTP/1.0” 200 3719 “-” “-“

I get one every five minutes or so which is about how often phantom hits get added. What on earth are they?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:59:27+00:00Added an answer on June 13, 2026 at 11:59 pm

    ::1 is localhost IPv6 address. That’s where I’d start looking if I were you. One of the apps is making these requests. Either track it down or just make check $_SERVER['REMOTE_ADDR'] if it’s not ::1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple test page for PHP session. <?php session_start(); if (isset($_SESSIONS['views']))
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();
I have simple php validation form that is halfway working. If you leave the
Thanks in advance! I have a simple mysql and php blog that I built
Hi guys I have a simple membership based website where users log in and
I have simple win service, that executes few tasks periodically. How should I pass
I have a Drupal website that has a page at the URL alias of
I have a simple animation based on jQuery fadeIn and fadeOut - it just
I'm designing a web based php reporting system. It involves multiple pages that insert
I have a simple string that I would like to save for later use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.