mathymus Posted December 7, 2006 Share Posted December 7, 2006 Hi guys,I have created a web site allowing users to download files. What i would like to do is to count the amount of times the file has been clicked. How would i create a php file to do this?Mathy Link to comment https://forums.phpfreaks.com/topic/29846-download-counter/ Share on other sites More sharing options...
trq Posted December 7, 2006 Share Posted December 7, 2006 Theres many tutorials on the subject if you search google for [i]php download counter[/i]. Link to comment https://forums.phpfreaks.com/topic/29846-download-counter/#findComment-137115 Share on other sites More sharing options...
Caesar Posted December 7, 2006 Share Posted December 7, 2006 Depends on the approach and your current code...but yeah:[code]<?php if($_GET['download'] == '1') { $db->connect(); $db->query("UPDATE counter SET downloads=downloads+1"); $db->close(); }?>[/code] Link to comment https://forums.phpfreaks.com/topic/29846-download-counter/#findComment-137122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.