You are here: Re: counting « HTML « IT news, forums, messages
Re: counting

Posted by J.O. Aho on 01/26/07 09:17

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация