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

  • Home
  • SEARCH
  • 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 6219161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:43:55+00:00 2026-05-24T07:43:55+00:00

Is there a simple script or piece of code I can add to my

  • 0

Is there a simple script or piece of code I can add to my page to keep a log of every visitor, the date and time they hit the page and IP address?
And what would be the best way to do this… javascript, php, something else?

EDIT:

Ouch…

Here is what happened… When I went to my server with FileZilla there were all the domain names (about 20) I have being logged like my domain.com so I found the one I needed and checked the logs but it was mainly search engines.

But I just went back and happened to scroll down to stuff that was out of view and there were all the domain names again with www in front like http://www.mydomain.com and of course the logs in there are huge and have every single bit of info I need.

This happened because I found what I was looking for mydomain.com and of course I stopped looking. I didn’t know or see there was a whole other set out of view… honest mistake.

I am still using that code because it is nice and small, the logs are freakin’ huge and take hours to download and look at.

  • 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-24T07:43:55+00:00Added an answer on May 24, 2026 at 7:43 am
    $line = date('Y-m-d H:i:s') . " - $_SERVER[REMOTE_ADDR]";
    file_put_contents('visitors.log', $line . PHP_EOL, FILE_APPEND);
    

    Consider also logging $_SERVER['REQUEST_URI'] or other interesting information, possibly in a more standard format as outlined by @Day.

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

Sidebar

Related Questions

I have a simple script where I am fetching an HTML page, passing it
In javascript suppose you have this piece of code: <div> <script type=text/javascript>var output =
I'm trying to write a simple script that effectively fades out the page content,
I have a simple piece of script (which uses RegEx) which cleans up a
I am writing a piece of code for a SSIS 2005 script component to
Are there simple libraries out there (.NET and Java) that are able to validate
There is simple cipher that translates number to series of . ( ) In
There is simple JSON serialization module with name simplejson which easily serializes Python objects
Is there a simple way of getting a HTML textarea and an input type=text
Is there a simple way to cache MySQL queries in PHP or failing that,

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.