p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Tracking downloads


Message #1 by Roy Van Tassel <jazzsnob@o...> on Sat, 21 Sep 2002 03:02:58 -0400
Hello. I want to be able to track downloads of an mp3 file. I want to track
IP and a count of how many times it is downloaded. Any ideas on how to do
that would be a great help. I can't find much on that subject unless it is
part of a statistics package already which doesn't help me at all...

Thanks in advance...



-----Original Message-----
From: Jamal [mailto:new_mojam@y...]
Sent: Saturday, September 21, 2002 3:01 AM
To: beginning php
Subject: [beginning_php] working with html form


Hi  Guys,
Can you please tell me why my html form tag is not working. I have some
files in which i used some html form  tags in them.Everytime i log in to
launch any of these files using my apache localhost server I get a blank
page.
Please tell me why.
Thanks
Mo Jam


Message #2 by "David Scott-Bigsby" <DScott-Bigsby@P...> on Mon, 23 Sep 2002 10:37:07 -0700
> Hello. I want to be able to track downloads of an mp3 file. I
> want to track
> IP and a count of how many times it is downloaded. Any ideas
> on how to do that would be a great help.

A very simple way would be to have the user link to a php file with the 
name of the mp3 file as an argument (e.g., 
/log.php?mp3=3Dpolkamadness.mp3).

Your php file would log the event then redirect the user's browser to 
the mp3 file using the header() function.

If you want to get fancy, the same script could, instead of using 
redirect, actually send back the mp3 mime-type and then pipe the file 
back as the php script's output, but that's a bit trickier, and the 
security benefits (no one can find the location of the returned file) 
may not be worth the effort.

dsb

***************************************       
David Scott-Bigsby
Product Manager, Web Site and PEDN

PureEdge Solutions
The Leader in Secure XML e-Forms

v:250-708-8145  f:250-708-8010
1-888-517-2675   www.PureEdge.com
***************************************


  Return to Index