Counter - referrer shows my site. Multiple IP's shown when getting page.

Posted on 2005-05-15
Last Modified: 2008-03-03
I have a counter with PHP/MySQL/JavaScript on every page. Here is how I call the script:

<script type="text/javascript">
  var refer=escape(document.referrer);
  var dim=screen.width + 'x' + screen.height;
  var pg = window.location.pathname;
  document.write('<img src="/count.php?pg='+pg+'&dim='+dim+'&refer='+refer+'">');
  <img src="/count.php">

For some of my statistics I see the refer being from my site. I looked at the apache logs for the IP's that show this and I see something like this: - - [08/May/2005:09:58:15 -0700] "GET /signup.htm HTTP/1.0" 304 - - - [08/May/2005:09:58:17 -0700] "GET /images/styles.css HTTP/1.0" 200 1195 - - [08/May/2005:09:58:18 -0700] "GET /images/logo.gif HTTP/1.0" 304 - - - [08/May/2005:09:58:18 -0700] "GET /images/bg.gif HTTP/1.0" 200 85 - - [08/May/2005:09:58:18 -0700] "GET /images/verification_seal.gif HTTP/1.1" 304 - - - [08/May/2005:09:58:18 -0700] "GET /images/shadow.gif HTTP/1.0" 304 - - - [08/May/2005:09:58:19 -0700] "GET /images/dot.gif HTTP/1.0" 304 - - - [08/May/2005:09:58:19 -0700] "GET /images/horizontal_solution_PP.gif HTTP/1.0" 304 - - - [08/May/2005:09:58:19 -0700] "GET /count.php?pg=/signup.htm&dim=1024x768&refer=http%3A// - - [08/May/2005:09:59:03 -0700] "GET /demo.htm HTTP/1.0" 200 7385 - - [08/May/2005:09:59:05 -0700] "GET /count.php?pg=/demo.htm&dim=1024x768&refer=http%3A// HTTP/1.0" 200 35 - - [08/May/2005:09:59:23 -0700] "GET /stats.php HTTP/1.0" 200 10289 - - [08/May/2005:09:59:24 -0700] "GET /count.php?pg=/stats.php&dim=1024x768&refer=http%3A// HTTP/1.0" 200 35 - - [08/May/2005:09:59:38 -0700] "GET /tutorials/ HTTP/1.0" 200 11048 - - [08/May/2005:09:59:39 -0700] "GET /count.php?pg=/tutorials/&dim=1024x768&refer=http%3A// HTTP/1.1" 200 35

These all appear to be from the same user, but they have different IP's. You'll notice that at the exact same second 4 of the images of the page were requested but they say they're from different IP's.

Any ideas how to fix it to not get duplicate entries that say they came from my site?
Question by:itcdr
    LVL 3

    Expert Comment

    what is the url of the page that this script is one?
    LVL 1

    Author Comment

    The PHP script for the counter is /count.php and the javascript is on every page of the site that calls it as an image. Is that what you're asking?
    LVL 10

    Accepted Solution


    You are geting this because the user is sitting behind a proxy server. The proxy server makes a request for the page then it grabs all the image links and passes those links to other proxy servers in their server farm, and they come and grab the images to add to their proxy cache just in case another user visits your page via their proxy server, they do this to save badwidth and have pages load faster by storing the images in thier cache!


    Just another good reason to hate AOL9s) way of doing things!


    LVL 1

    Author Comment

    Thanks for the explanation. That makes sense.

    Now what should I do to fix it?
    LVL 7

    Expert Comment

    A little BTW comment on this... when I last checked AOL during a development process, I found that the images from my website, as well as being cached had also been converted to a proprietary AOL file format, presumably so that they could be 'compressed further'. I think their file format is called PIC. Interesting that they would go to all that bother, isn't it. Brings to mind possible intellectual property/copyright issues too, a la Google Images.

    LVL 1

    Author Comment

    Now that we know what is causing the problem, how do we fix it?
    LVL 1

    Author Comment

    Any ideas how I can get the php counter to check for this?
    LVL 14

    Expert Comment

    No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
    I will leave the following recommendation for this question in the Cleanup topic area:
    Accept: mensuck

    Any objections should be posted here in the next 4 days. After that time, the question will be closed.

    EE Cleanup Volunteer

    Featured Post

    Easy Project Management (No User Manual Required)

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now