Jump to content

Link triggers code?


Zero767

Recommended Posts

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!  ;D

Link to comment
https://forums.phpfreaks.com/topic/45109-link-triggers-code/
Share on other sites

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. 

Link to comment
https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-219917
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.