PDA

View Full Version : Tracking requests for data records:


Shalazar
02-07-2000, 08:23 PM
One thing I'd like to include in a future database-driven website, is the ability to track the most popular downloads or file-views, and be able to display those on a main page (in something like, "The Top 10 most popular requests")

Does anyone have any idea where I could find some info to start figuring out how to do this?

Brian
02-07-2000, 08:29 PM
There are several such scripts at http://cgi.resourceindex.com/Programs_and_Scripts/Perl/File_Downloading/

Regards,
Brian
[This message has been edited by Brian (edited 02-07-00@7:33 pm)]

Shalazar
02-08-2000, 12:28 AM
Those PERL scripts are nasty, and require tacking on extra information to your url and filename, and if the script ever decided to go haywire, all your files go offline.

I'm looking for a PHP solution.[nbsp][nbsp]I'm figuring, vaguely, that I would have to add an extra column to these tables containing my files, named somthing like (download_times).[nbsp][nbsp]Would they have to be started at 0, or NULL, or what?

And what kind of calls would be required to increment that column by one each time that data record was accessed?

Justin
02-08-2000, 03:37 AM
...and if the script ever decided to go haywire, all your files go offline. As is the case with just about anything... No matter what you do, it will require some extra effort to ensure that this does not happen - and either way you will have to find a way to tell the script (be it Perl or PHP) what you want it to do, whether it's via a URL, cookie, or if the script is actually serving the data...

Regardless of the programming language used, any number of things can go wrong - careful programming/implimentation can prevent most of these types of errors.

I would personally use PHP/MySQL or Perl/MySQL, and log nothing more than a "hit", as though it were a counter (unless you want to add in coding to, say, not increment if the same IP is used too many times (prevent someone from giving their file a higher d/l rating, for example), or other special tricks...)

Hope this helps.

------------------
Justin Nelson
FutureQuest (http://www.FutureQuest.net/index.php) Support