Results 1 to 4 of 4

Thread: multi hit counter help

  1. #1
    Registered
    Join Date
    May 2009
    Location
    us
    Posts
    4
    Rep Power
    0

    multi hit counter help

    I am trying to use a multihit counter on my site (safarikitty.com) and can't seem to get it to work. I got from a friend who used on her site several years ago. I am new to scripting, but followed the instructions and cant seem to get it too work.

    I am assuming it is a path problem, as there is only a couple changes to make in the script. Here is the instructions:

    # EXPLANATION
    #
    # Your counter is actually calling a perl script that is piping a gif file
    # to your browser. This is done by placing the location of the perl script
    # in place of where you would normally specify an image. For example,
    #
    # instead of <img src="../pix/this_pic.gif">
    #
    # you would specify <img src="../cgi-bin/multi-hit.pl">
    #
    # and that will call the perl script which will send the gif file to
    # your browser. Now, notice that appended to the name of multi-hit.pl
    # is a funny looking combination of characters. These characters define
    # additional information needed by the script to understand which digit
    # to send to the browser. These characters designate the right-most digit,
    # starting with 0 For example:
    #
    # 6 5 4 3 2 1 0
    #
    # Represents the order, from left to right the number, as it will appear. If
    # you have a 4 digit hit counter, then the order of the numbers will be
    #
    # 3 2 1 0
    #
    # To set up a four-digit hit counter, you would do the following:
    #
    # <img src="../cgi-bin/multi-hit.pl?3=index" width="12" height="20">
    # <img src="../cgi-bin/multi-hit.pl?2=index" width="12" height="20">
    # <img src="../cgi-bin/multi-hit.pl?1=index" width="12" height="20">
    # <img src="../cgi-bin/multi-hit.pl?0=index" width="12" height="20">
    #
    # The syntax is
    #
    # multi-hit.pl?X=any_name
    #
    # Where "multi-hit.pl" is the name of the script. "?" designates the
    # start of the additional information used by the script. Then you
    # specify a number which will be a digit. All the number have to start
    # from 0. Even if you have a 1 digit counter, you must start from 0,
    # otherwise the script won't work. So, the rest of this code snippet
    # is
    #
    # ?X=any_name
    # ^^^^^^^^
    # Any name you want goes here (try to avoid funny characters).
    #
    # In human terms, read
    #
    # Question-mark, then any digit in place of X, equals a particular name.
    #
    # Make sure that your names are unique for each page you use this counter with.
    # Multi-hit records all the hits for all the pages in one file.
    #
    # With regard to the rest of the parameters, make sure the width and height
    # in the <src img. . .> field corresponds to the dimensions of your counters.
    # The examples above use the same dimensions of the gif files that come
    # with this script.

    # SETTING UP THE SCRIPT

    # On the very first line (above), put the location of your perl interpreter.
    # Do this by placing #! and then the perl interpreter's path.
    # If you are not sure where your perl interpreter is, then ask your
    # system administrator.
    #
    # The next thing is to specify the location of HIT_FILE. HIT_FILE
    # keeps track of all the numbers of all the pages that access
    # this script. After selecting a directory, designate an empty
    # file and enter the name and path in the following way:
    #
    # $HIT_FILE="/my_path/on/the_web/my_hit_stats.ext";
    #
    # or use any other such name for your file.
    # If you are using unix/linux, make sure you chmod 644 or chmod 666
    # your file so the program can write to it. On WinNT, make sure
    # it is in a directory with read/write access.
    #
    # The next directory to configure is $PIX_DIR, which is the location
    # of all your gif numbers. You should have numbers 0 - 9 plus a
    # blank counter for digits which you have not yet reached. Place
    # all these files in a directory, and enter the path of that directory
    # as follows:
    #
    # $PIX_DIR="/my/pictures/";
    #
    # NOTE: MAKE SURE YOUR LINE ENDS WITH A SEMICOLON.
    # If you are not sure what the path/location of your directory
    # on your site is, if you are telneting in, go to your directory
    # and type
    #
    # pwd
    #
    # And that will tell you where the server thinks you are.
    # If you are using an FTP client, there is usually a corresponding
    # command in your utility.
    #
    # All your numbers should be gif files, should be uniform in size,
    # and I recommend using only two colors and specifying that the
    # background is transparent. This way whatever cool background
    # you choose for your site will not be blocked out. Here are the
    # files you should have:
    #
    # 0.gif
    # 1.gif
    # 2.gif
    # .
    # .
    # .
    # 9.gif
    # blank.gif
    #
    # Note, if you name your blank.gif BLANK.GIF or use caps anywhere,
    # it won't be recognized on a unix/linux system because the file
    # system is case sensitive--be careful.
    #
    # And finally, on unix/linux systems, make sure this file is chmod 755
    # so it can execute.


    Here is what I got for the paths:
    $HIT_FILE="/www/s/safarikitty/htdocs/cgi-bin/counter/my_hits.txt"; # file where hits are located.
    $PIX_DIR="/www/s/safarikitty/htdocs/cgi-bin/counter/"; # All numbers are marked 0 - 9 plus a blank.

    The pics are in the same directory as the counter file.

    This is what I got on the web page:
    <!--begin multi-hit hit counter-->
    <div align="center"> <img src="../cgi-bin/multi-hit.pl?6=index" width="12" height="20">
    <img src="../cgi-bin/counter/multi-hit.pl?5=index" width="12" height="20"> <img src="../cgi-bin/counter/multi-hit.pl?4=index" width="12" height="20">
    <img src="../cgi-bin/counter/multi-hit.pl?3=index" width="12" height="20"> <img src="../cgi-bin/counter/multi-hit.pl?2=index" width="12" height="20">
    <img src="../cgi-bin/counter/multi-hit.pl?1=index" width="12" height="20"> <img src="../cgi-bin/counter/multi-hit.pl?0=index" width="12" height="20">

    <!--end multi-hit hit counter-->

    Any ideas?

  2. #2
    Custom User Title entrecon's Avatar
    Join Date
    Aug 2006
    Location
    Michigan
    Posts
    2,742
    Rep Power
    16
    Don't use a counter?

    I read this years ago and now it always bothers me when I see one. What good is a counter? If you don't get alot of hits, you just embarass yourself when a new visitor stops by. If you get alot of hits, I really don't care.

    My suggestion? don't use the counter and keep track of your number of visitors using one of the available stats programs.
    ________________________________
    Find me on twitter: @entrecon

  3. #3
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    Not in Solomons anymore.
    Posts
    3,441
    Rep Power
    21
    Here is what I got for the paths:
    $HIT_FILE="/www/s/safarikitty/htdocs/cgi-bin/counter/my_hits.txt"; # file where hits are located.
    $PIX_DIR="/www/s/safarikitty/htdocs/cgi-bin/counter/"; # All numbers are marked 0 - 9 plus a blank.
    These paths are wrong. The correct Doc Root (path to htdocs) can be found in OPS (Services | HTTP).

    This is what I got on the web page:
    <!--begin multi-hit hit counter-->
    <div align="center"> <img src="../cgi-bin/multi-hit.pl?6=index" width="12" height="20">
    <img src="../cgi-bin/counter/multi-hit.pl?5=index" width="12" height="20"> <img src="../cgi-bin/counter/multi-hit.pl?4=index" width="12" height="20">
    <img src="../cgi-bin/counter/multi-hit.pl?3=index" width="12" height="20"> <img src="../cgi-bin/counter/multi-hit.pl?2=index" width="12" height="20">
    <img src="../cgi-bin/counter/multi-hit.pl?1=index" width="12" height="20"> <img src="../cgi-bin/counter/multi-hit.pl?0=index" width="12" height="20">
    These paths are probably wrong, unless your sites files are located in a directory under htdocs.
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

  4. #4
    Rick
    Join Date
    May 2002
    Location
    Minneapolis, MN
    Posts
    1,753
    Rep Power
    19
    Counters are useful for monitoring which of your pages is attracting the most traffic, how those traffic patterns change over time, and for differentiating between real users and automated accesses from search engine robots and other 'bots'. Web statistics programs based on server logs can often provide this information, but in some environments the server logs can be less reliable than page-based traffic monitoring methods.
    Rick Trethewey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •