Re: [PHP] is there a way to track downloads

2002-06-23 Thread Duncan Hill

On Sun, 23 Jun 2002, Kevin J wrote:

 Hey all,
 
 I would like to place some files on my site and use PHP to track how many
 users have downloaded those files.
 
 Is this possible?

Approach the problem logically:

1) You have a series of files that you want people to download.
2) You want to track which files are downloaded.
3) You don't want people accessing the files directly.

So, a file called download.php.
Accepts a parameter - the file name to make available.
Logs an entry of IP and file (and whatever else) to a file / database / 
whatever.
Makes the file available to the user - but the path is hidden / created on 
the fly so that a particular file cannot be pulled without going through the 
script.

The actual code is left as an excercise for the reader.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] is there a way to track downloads

2002-06-23 Thread Kevin J

Hello,

My fault, I didn't state that i was a complete Newbie to PHP.

I am looking at scripts and realize that I need to use a database for this,
etc... so I am just gonna forget the whole thing.

Thanks anyways

Kevin J

Duncan Hill [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Sun, 23 Jun 2002, Kevin J wrote:

  Hey all,
 
  I would like to place some files on my site and use PHP to track how
many
  users have downloaded those files.
 
  Is this possible?

 Approach the problem logically:

 1) You have a series of files that you want people to download.
 2) You want to track which files are downloaded.
 3) You don't want people accessing the files directly.

 So, a file called download.php.
 Accepts a parameter - the file name to make available.
 Logs an entry of IP and file (and whatever else) to a file / database /
 whatever.
 Makes the file available to the user - but the path is hidden / created on
 the fly so that a particular file cannot be pulled without going through
the
 script.

 The actual code is left as an excercise for the reader.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] is there a way to track downloads

2002-06-23 Thread Henry

i have a opensource redirect script that can easily be adapted to track downloads - 
just need to
replace a absolute url for a file name.

check it out at http://user:[EMAIL PROTECTED]/lab

cheers
Henry



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php