freaka Posted September 15, 2008 Share Posted September 15, 2008 I'm trying to write a script that counts the number of times that a file has been downloaded and have the results stored in a flat file. Can anyone give me some pointers as to how this is done? I've never used flat file databases before, except for a simple visits counter. If anyone can please help me out by pointing me in the right direction I would greatly appreciate it. By the way, this forum rocks and has helped me a lot in my scripting education. Thanks to all the posters that have helped me and everyone else over the years. Link to comment https://forums.phpfreaks.com/topic/124392-flat-file-click-tracker/ Share on other sites More sharing options...
Caesar Posted September 15, 2008 Share Posted September 15, 2008 Don't make the link directly link to the file. Point the link to a url that will trigger a PHP method/function that will force the download. That way the part of the script that updates your counter is only updated on actual clicks. :-) Link to comment https://forums.phpfreaks.com/topic/124392-flat-file-click-tracker/#findComment-642396 Share on other sites More sharing options...
freaka Posted September 15, 2008 Author Share Posted September 15, 2008 Yeah, I get that, but I'm trying to write the script. I need to know how to setup a flatfile db that tracks the click numbers. I dont understand how to write to and read from the db. Can anyone please show me how to, or at least point me to a website that shows you how in a detailed way? Link to comment https://forums.phpfreaks.com/topic/124392-flat-file-click-tracker/#findComment-642405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.