Title: PHP: Count and track daily downloads from a website Post by: Hellraiser on August 29, 2007, 02:50:44 PM Count and track daily downloads from a website
Installation Create a database named [download] or the same as the db_name variable in config.php Create a folder/directory on your server named downloads Modify the following variables in config.php to suit your own needs $db_host : the name of your server - often called localhost $db_user : the username of your server $db_pass : the MySQL password for the $db_user $db_name : the MySQL database name $dl_path : the path to your download location from where you have installed download.php $dl_absolute_path : the absoulte path to download.php - e.g. http://www.mikeleigh.com/download.php Copy the following files to your domain root (mydomain.com) download.php Copy the following files to your newly created download directory admin.php adminexec.php database.php config.php upgrade01_02.php false.gif true.gif database.php is used to create the tables on your MySQL database. You can also use phpMyAdmin and create the table structure manually. Open a web broswer and goto http://www.yourdomain.com/downloads/database.php or http://www.yourdomain.com/downloads/upgrade.php if you are upgrading to set up the database tables and default entries Open a web broswer and goto http://www.yourdomain.com/downloads/admin.php use the username of admin with password 1234 (the password for admin stored in the user table is an md5 hash of the string 1234). You can now set up your file downloads. Note that each downloads has to have a file associated with it. Notes - FOR UPGRADING The url form of download.php?fileid=1 is now depracated, use instead download.php?file=1 or download.php?download=1 At some point in time the url form of download.php?fileID=1 will be removed. In the meantime I have left comments in the code of where this is so you can use both forms of the url to download files. I advise that you update your links and listings to the new form as at some point in the future the old form will be removed. It has been left in because mamy search engines will need time to update the linke to the new form of the url. This will not have any effect if this is your first installation of the Download Counter. Upgrading from 0.1 Please pay special attention here if you are upgrading. 1) backup backup backup backup backup your database and Download Counter files in case you need to roll back. Enough said on this I think :) 2) there is an upgrade.php script which you will need to run (just like running the database.php script), dont run the database.php script. The upgrade script will alter exsiting tables, add new tables and insert the admin user password. Download the Attached File below [Note: If u can't see any file attached, Please Register and Login with your id.] |