counting

Discussion in 'HTML' started by hba2pd, Jan 26, 2007.

  1. hba2pd

    hba2pd Guest

    Hello,

    I know how to count an access to an index.html file, but I would like
    to know:

    1. I would like to know how to count the number of times a link is
    clicked. A link is to a pdf file.

    2. I would like to know how to count the number of time a directory is
    accessed. In that directory, I just put various pdf files, but I do not
    put index.html file.

    Thank you,
     
    hba2pd, Jan 26, 2007
    #1
    1. Advertising

  2. hba2pd

    J.O. Aho Guest

    hba2pd wrote:
    > Hello,
    >
    > I know how to count an access to an index.html file, but I would like
    > to know:
    >
    > 1. I would like to know how to count the number of times a link is
    > clicked. A link is to a pdf file.


    Easy way is to use a server side script language, best option would be PHP as
    you won't get limited to one operatingsystem.

    Instead of calling directly the file you want people to download, you make a
    "wrapper" script, that keeps the count (save result to a file or to a sql
    server, mysql is a popular choice), and then feeds the user with the file. Not
    really that advanced to make.


    > 2. I would like to know how to count the number of time a directory is
    > accessed. In that directory, I just put various pdf files, but I do not
    > put index.html file.


    This works kind of the same as the previous one, you have to include a
    index.php file into the directory, the php script will list the files in the
    directory, as it lists the files it will also store the number of times the
    directory has been accessed to that file or database.
    This too is quite easy to do.

    You find useful examples in the online manual at www.php.net and there are
    loads of script sites, just see to that you get a script that is written to
    the version of PHP you are using, or you may have to make some modifications
    yourself.


    --

    //Aho
     
    J.O. Aho, Jan 26, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray Cassick \(Home\)

    Re: tired of counting.... UDP socket bug

    Ray Cassick \(Home\), Jan 13, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    592
    mikeb
    Jan 13, 2004
  2. Willy Denoyette [MVP]

    Re: tired of counting.... UDP socket bug

    Willy Denoyette [MVP], Jan 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    508
    Willy Denoyette [MVP]
    Jan 13, 2004
  3. Feroze [MSFT]

    Re: tired of counting.... UDP socket bug

    Feroze [MSFT], Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    376
    Feroze [MSFT]
    Jan 19, 2004
  4. Steve

    Counting bits

    Steve, May 6, 2004, in forum: VHDL
    Replies:
    7
    Views:
    6,209
    Charles Bailey
    May 12, 2004
  5. edwardfredriks

    counting up instead of counting down

    edwardfredriks, Sep 6, 2005, in forum: Javascript
    Replies:
    6
    Views:
    235
    Dr John Stockton
    Sep 7, 2005
Loading...

Share This Page