Downloaded % times, how is it done?


Apple lover, PC User

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?

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.
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 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
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 ...
What a long strange trip it's been. =)

Forum statistics

Latest member