King_Karlssen Posted January 19, 2006 Share Posted January 19, 2006 For my website, http://www.kingkarlssen.net , I'm try to make a download, which I know how to do know thanks you guys, a download that everytime it is downloaded, it will change the number of times its been downloaded. I want to display the number of how many times the file has been downloaded, and have the site keep accurate track of how many times it has been downloaded. So if it has been downloaded 7 times, I want it to say, "Downloaded 7 times" etc. I know how to create a function and variable for this but it refreshes everytime and starts back at zero. Anyone know how to do this? Link to comment Share on other sites More sharing options...
Skemcin Posted January 19, 2006 Share Posted January 19, 2006 You'll need a server side sripting language to do this. If you're suing javascript - then it (at best) can only keep track of how many times one individual downloads the file - and that would only be available to that person.Here is who I would set it up. lets say this is your file kingkarlssen.net/files/xxxxxx.xxx create a page with nothing on it except a meta refresh tag that points to your file (maybe put something on the page but lets start with nothing. that page would have to be a php, asp, or cold fusion page to avoid using a database, make a file (filecount.txt) and put a 0 in it - nothing else your php, asp, or cold fusion page will be programmed to read the contents of the txt file and add 1 to the number it reads everytime the page is run (since this is the page with the meta refresh tag that prompts the download) on what ever page you want to display your counter, you'll need to write something to read that txt file. I've done this several times with cold fusion and have even used it to generate unique one-time gift certificate numbers. I can offer you the code, but I'm assuming you are like most folks here and do not use cold fusion.BTW - that is a HUGE dog above the main entrance to your school - wouldn't recommend standing under that on a windy day:)Oh, and this is how you spell Curricular - just in case your english teacher runs into your site. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now