I Wanna Make It Where When Someone Clicks The Download Button, The Counter On Tye Page Tells Me How Many Times Its Been Downloaded!! Help Me!!
How To Connect My Download Button With A Counter? |
(Jun 30, 2016 12:57 PM)ihatevim Wrote: Create a counter variable and print the variable. Add one to the value on button interaction. Sherlock holmes in the house right here
FS Webdeveloper
(Jun 30, 2016 12:59 PM)SteezyHB Wrote: Sherlock holmes in the house right here God forbid someone provides the pseudocode as opposed to posting the first link they google'd. ![]()
When someone clicks on the link it should point to a PHP file that reads a file with one single number in it, add +1 to the number and overwrite the file with the number, then redirect to the actual file with header().
You see, Doctor, God didn't kill that little girl. Fate didn't butcher her and destiny didn't feed her to those dogs.
If God saw what any of us did that night he didn't seem to mind. From then on I knew... God doesn't make the world this way. We do. (Jul 1, 2016 06:42 AM)Squito Wrote: When someone clicks on the link it should point to a PHP file that reads a file with one single number in it, add +1 to the number and overwrite the file with the number, then redirect to the actual file with header(). I like this approach. Create 2 new files:
Example code for download.php; PHP Code Then you can just link the download.php file where your download button is using a simple code, for example; Code <a href="download.php">Download</a>To display the number of downloads; PHP Code (Jul 1, 2016 10:07 AM)SIM-545076 Wrote: Create 2 new files: You mean create a counter.txt with the content: 0. Also make sure that the counter.txt is writable (666 or 777 rights). You see, Doctor, God didn't kill that little girl. Fate didn't butcher her and destiny didn't feed her to those dogs.
If God saw what any of us did that night he didn't seem to mind. From then on I knew... God doesn't make the world this way. We do. |
|
|



![[Image: qZ42qWp.jpg]](https://i.imgur.com/qZ42qWp.jpg)
![[Image: TrJCrgs.jpg]](https://i.imgur.com/TrJCrgs.jpg)
