Downloaded % times, how is it done?

lieb39

Apple lover, PC User
#1
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
 
#2
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.
 
#4
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. :)
 
S

sailgreg

Guest
#5
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
 
#6
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 posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,970
Messages
673,297
Members
89,016
Latest member
Poseeut