Downloaded % times, how is it done?

lieb39

Apple lover, PC User
Joined
27 Nov 2002
Messages
526
Question,

I notice when a person posts a attachment, for example their desktop as a .jpg, you guys (ntfs) put a lil but of text under the link, saying Downloaded % times (% = amount of times downloaded) How do you do this, or if you can, what is your code?

Thanks
 
Well it's like this. Each file is given an ID that is stored in the database. When you click the link it goes to a special download page (attachment.php in this case). This page checks the ID against the database, ticks off another download on a counter and redirects the browser to the acctual file.
 
never new that. I just don't care about how the message board handels things
 
Originally posted by aswettla
never new that. I just don't care about how the message board handels things
That's kind of the point. :) Good programming is made so that the user doesn't have to think about what happens. He/she only clicks, types and posts so to speak. :)
 
You can do this yourself with a text file, when you click the download link make it goto download.php?file={filename} have that PHP Script add +1 to the counter and then have it change the header to {filename} and it will all work nice :p
 
Only problem is that many hosts (free anyway) deny access to the file system for security reasons. But on a paid or own server it'll work.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back