Zero767 Posted April 1, 2007 Share Posted April 1, 2007 Hey, im doing a download counter sort of thing. How can I make the code that adds the data begin after they click the download link. Also, what would be my best option of sotring the data. just including a php file with an array of all the downloads, then change the variables from there. A database? Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/45109-link-triggers-code/ Share on other sites More sharing options...
interpim Posted April 1, 2007 Share Posted April 1, 2007 use an onclick() in javascript to run your code maybe Quote Link to comment https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-218987 Share on other sites More sharing options...
Zero767 Posted April 1, 2007 Author Share Posted April 1, 2007 Alright, I will give it a shot. Any suggestions as to how I should talley my clicks? Keep in mind there are 217 files that need to have download ratings. Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-219015 Share on other sites More sharing options...
hackerkts Posted April 1, 2007 Share Posted April 1, 2007 I would suggest you to use php with MySQL database, last time I had read a tutorial on it and rewrite it, take a look at http://www.cwhnetworks.com/forums/index.php?showtopic=3395 Quote Link to comment https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-219027 Share on other sites More sharing options...
Zero767 Posted April 1, 2007 Author Share Posted April 1, 2007 yea, thats what I first thought of doing, but I would prefer not making 217 fields for all of my files. I suppose it would be easier to just make a query then run it through, but still. That is a lot of fields. if it comes down to is I suppose I can do it. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-219197 Share on other sites More sharing options...
Zero767 Posted April 2, 2007 Author Share Posted April 2, 2007 Ok, the onclick() doesnt seem to work. Any other ideas? Quote Link to comment https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-219899 Share on other sites More sharing options...
.josh Posted April 2, 2007 Share Posted April 2, 2007 well if you want to keep track of how many of each was downloaded, you're going to have to have something unique about each file, be it a name or id or something. You could setup a table in a database with as little as 2 fields: one called filename and one called amount (or whatever). whenever the file is downloaded, you would just run a query to update the row where filename = file that was clicked. You will have 217 rows of data, yes, but that's just a fact of life, and that number will vary, depending on how many files you have. However, you will still just use those 2 fields (columns) for each one. Quote Link to comment https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-219917 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.