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 6842557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:06:53+00:00 2026-05-27T00:06:53+00:00

I would like to track all views to a page using php and mysql.

  • 0

I would like to track all views to a page using php and mysql. I will be tracking the number of times a person viewed the page and the ip address along with the current date. However is there a way to make sure your tracking actual users rather than bots/spiders?

  • 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-05-27T00:06:53+00:00Added an answer on May 27, 2026 at 12:06 am

    Two options that I see:

    1. Create a “hidden” link on your home page to a honey pot. Any one who hits the honey pot page should be considered a bot and not included in your stats

    2: Not a fool proof way, but you could compare the browser’s User Agent string to a white list of known web browsers. This string can be spoofed so its not the most reliable.

    Personally, I’d go with the first option.

    For the honey pot:

    on your home page I’d add something like this:

    <a href="totallyNotATrap.php" style="Display:none">ReallyNotATrap</a>
    

    and on the honey pot page itself something like this:

    $BotIp=$_SERVER['REMOTE_ADDR'];
    //DB connection 
    Insert into BlackList($BotIp,$Date,$otherDataYouCareAboutLogging);
    //close DB Connection
    

    Then for your stats code simply compare every user’s Ip to the BlackList table. If the user isn’t on it, record the stats.

    EDIT

    As pointed out below, googlebot can get tricked by this. If this is something that matters to you (if your just filtering for your own stats and not filtering content it shouldn’t matter), include your honeypot page in your Robots.txt. Google will read the text file and avoid the trap. Other nasty bots will fall into it. Since google will avoid our trap, I would also use option 2 and filter out Google’s User Agent String from the stats.

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

Sidebar

Related Questions

I have a xml web service which I would like to track using Google
I'm experiencing an issue with ActiveMQ and would like to trace/view all ActiveMQ activity.
I would like to track how many surveys have been done by different departments
I am making a small game in flash, I would like to track scores
I currently have a controller were I would like to keep track of logging
I have various models of which I would like to keep track and collect
I would like to confirm whether I am on the right track when identifying
Would like to get a list of advantages and disadvantages of using Stored Procedures.
I'm using Google Analytics to track eCommerce. The checkout page is is dynamic with
I am developing a page view counter to track the amount of views a

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.